Interface Blob

All Known Subinterfaces:
WritableBlob
All Known Implementing Classes:
MemoryBlob, OverflowBlob

public interface Blob
Stores binary data.

Not that blobs are not thread safe. While they support requesting multiple concurrent input streams, these streams must be used in the same thread, unless appropriate synchronization or locking is done.

  • Method Summary

    Modifier and Type
    Method
    Description
    Get an input stream to read the data in the blob.
    long
    Get the length of the data in the blob, i.e.
    void
    Write the data to a given output stream.
  • Method Details

    • getInputStream

      InputStream getInputStream() throws IOException
      Get an input stream to read the data in the blob.
      Returns:
      the input stream to read the data from
      Throws:
      IOException
    • writeTo

      void writeTo(OutputStream out) throws StreamCopyException
      Write the data to a given output stream.
      Parameters:
      out - The output stream to write the data to. This method will not close the stream.
      Throws:
      StreamCopyException - Thrown if there is an I/O when reading the data from the blob or when writing it to the stream. StreamCopyException.getOperation() can be used to determine whether the failed operation was a read or a write.
    • getLength

      long getLength()
      Get the length of the data in the blob, i.e. the number of bytes.
      Returns:
      the length of the data in the blob