Interface IonLob

All Superinterfaces:
Cloneable, IonValue
All Known Subinterfaces:
IonBlob, IonClob

public interface IonLob extends IonValue
Common functionality of Ion blob and clob types.

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

  • Method Details

    • newInputStream

      InputStream newInputStream()
      Creates a new InputStream that returns the data as raw bytes.
      Returns:
      a new stream positioned at the start of the lob, or null if this.isNullValue().
    • getBytes

      byte[] getBytes()
      Gets all the data of this lob, or null if this is an Ion null value.
      Returns:
      a new byte array, or null if this.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 be null to make this an Ion null value.
    • 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 length bytes from the given array into this value, starting at the given offset in the array.

      Parameters:
      bytes - the new data for the lob; may be null to make this an Ion null value.
      offset - the offset within the array of the first byte to copy; must be non-negative and no larger than bytes.length.
      length - the number of bytes to be copied from the given array; must be non-negative and no larger than bytes.length - offset.
      Throws:
      IndexOutOfBoundsException - if the preconditions on the offset and length parameters 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: IonValue
      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 IonValue.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.

      Specified by:
      clone in interface IonValue
      Throws:
      UnknownSymbolException - if any part of this value has unknown text but known Sid for its field name, annotation or symbol.