Top Description Fields Methods
com.amazon.ion

public Interface IonLob

extends IonValue
Known Direct Subinterfaces
com.amazon.ion.IonBlob, com.amazon.ion.IonClob
Known Direct Implementers
com.amazon.ion.impl.lite.IonLobLite
Imports
java.io.InputStream

Common functionality of Ion blob and clob types.

Warning

This interface should not be implemented or extended by code outside of this library.

Field Summary

Inherited from com.amazon.ion.IonValue:
EMPTY_ARRAY

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the lob's size in bytes.
byteSize
()

Gets the size in bytes of this lob.

public IonLob
clone()

Redeclares com.amazon.ion.IonValue.clone.

Creates a copy of this value and all of its children.

public byte[]

Returns:

a new byte array, or null if this.isNullValue().
getBytes
()

Gets all the data of this lob, or null if this is an Ion null value.

public InputStream

Returns:

a new stream positioned at the start of the lob, or null if this.isNullValue().
newInputStream
()

Creates a new InputStream that returns the data as raw bytes.

public void
setBytes(byte[]
the new data for the lob; may be null to make this an Ion null value.
bytes
)

Sets the data of this lob, copying bytes from an array.

public void
setBytes(byte[]
the new data for the lob; may be null to make this an Ion null value.
bytes
,
int
the offset within the array of the first byte to copy; must be non-negative and no larger than bytes.length.
offset
,
int
the number of bytes to be copied from the given array; must be non-negative and no larger than bytes.length - offset.
length
)

Sets the data of this lob, copying bytes from part of an array.

Inherited from com.amazon.ion.IonValue:
acceptaddTypeAnnotationclearTypeAnnotationsequalsgetContainergetFieldIdgetFieldNamegetFieldNameSymbolgetSymbolTablegetSystemgetTypegetTypeAnnotationsgetTypeAnnotationSymbolshashCodehasTypeAnnotationisNullValueisReadOnlymakeReadOnlyremoveFromContainerremoveTypeAnnotationsetTypeAnnotationssetTypeAnnotationSymbolstopLevelValuetoPrettyStringtoStringtoStringwriteTo

Method Detail

byteSizeback to summary
public int byteSize()

Gets the size in bytes of this lob.

Returns:int

the lob's size in bytes.

cloneback to summary
public IonLob clone() throws UnknownSymbolException

Redeclares com.amazon.ion.IonValue.clone.

Doc from com.amazon.ion.IonValue.clone.

Creates a copy of this value and all of its children. The cloned value may use the same shared symbol tables, but it will have an independent local symbol table if necessary. The cloned value will be modifiable regardless of whether this instance isReadOnly().

The cloned value will be created in the context of the same ValueFactory as this instance; if you want a copy using a different factory, then use ValueFactory#clone(IonValue) instead.

Exceptions
UnknownSymbolException:
if any part of this value has unknown text but known Sid for its field name, annotation or symbol.
getBytesback to summary
public byte[] getBytes()

Gets all the data of this lob, or null if this is an Ion null value.

Returns:byte[]

a new byte array, or null if this.isNullValue().

newInputStreamback to summary
public InputStream newInputStream()

Creates a new InputStream that returns the data as raw bytes.

Returns:InputStream

a new stream positioned at the start of the lob, or null if this.isNullValue().

setBytesback to summary
public void setBytes(byte[] bytes)

Sets the data of this lob, copying bytes from an array.

Parameters
bytes:byte[]

the new data for the lob; may be null to make this an Ion null value.

setBytesback to summary
public void setBytes(byte[] bytes, int offset, int length)

Sets the data of this lob, copying bytes from part of an array.

This method copies length bytes from the given array into this value, starting at the given offset in the array.

Parameters
bytes:byte[]

the new data for the lob; may be null to make this an Ion null value.

offset:int

the offset within the array of the first byte to copy; must be non-negative and no larger than bytes.length.

length:int

the number of bytes to be copied from the given array; must be non-negative and no larger than bytes.length - offset.

Exceptions
IndexOutOfBoundsException:
if the preconditions on the offset and length parameters are not met.