Package com.amazon.ion
Interface IonLob
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
Fields inherited from interface com.amazon.ion.IonValue
EMPTY_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionintbyteSize()Gets the size in bytes of this lob.clone()Creates a copy of this value and all of its children.byte[]getBytes()Gets all the data of this lob, ornullif this is an Ionnullvalue.Creates a newInputStreamthat returns the data as raw bytes.voidsetBytes(byte[] bytes) Sets the data of this lob, copying bytes from an array.voidsetBytes(byte[] bytes, int offset, int length) Sets the data of this lob, copying bytes from part of an array.Methods inherited from interface com.amazon.ion.IonValue
accept, addTypeAnnotation, clearTypeAnnotations, equals, getContainer, getFieldId, getFieldName, getFieldNameSymbol, getSymbolTable, getSystem, getType, getTypeAnnotations, getTypeAnnotationSymbols, hashCode, hasTypeAnnotation, isNullValue, isReadOnly, makeReadOnly, removeFromContainer, removeTypeAnnotation, setTypeAnnotations, setTypeAnnotationSymbols, topLevelValue, toPrettyString, toString, toString, writeTo
-
Method Details
-
newInputStream
InputStream newInputStream()Creates a newInputStreamthat returns the data as raw bytes.- Returns:
- a new stream positioned at the start of the lob,
or
nullifthis.isNullValue().
-
getBytes
byte[] getBytes()Gets all the data of this lob, ornullif this is an Ionnullvalue.- Returns:
- a new byte array,
or
nullifthis.isNullValue().
-
setBytes
void setBytes(byte[] bytes) Sets the data of this lob, copying bytes from an array.- Parameters:
bytes- the new data for the lob; may benullto make this an Ionnullvalue.
-
setBytes
void setBytes(byte[] bytes, int offset, int length) Sets the data of this lob, copying bytes from part of an array.This method copies
lengthbytes from the given array into this value, starting at the given offset in the array.- Parameters:
bytes- the new data for the lob; may benullto make this an Ionnullvalue.offset- the offset within the array of the first byte to copy; must be non-negative and no larger thanbytes.length.length- the number of bytes to be copied from the given array; must be non-negative and no larger thanbytes.length - offset.- Throws:
IndexOutOfBoundsException- if the preconditions on theoffsetandlengthparameters are not met.
-
byteSize
int byteSize()Gets the size in bytes of this lob.- Returns:
- the lob's size in bytes.
-
clone
Description copied from interface:IonValueCreates 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 instanceIonValue.isReadOnly().The cloned value will be created in the context of the same
ValueFactoryas this instance; if you want a copy using a different factory, then useValueFactory.clone(IonValue)instead.- Specified by:
clonein interfaceIonValue- Throws:
UnknownSymbolException- if any part of this value has unknown text but known Sid for its field name, annotation or symbol.
-