Class V10InputBlob

All Implemented Interfaces:
AutoCloseable, FbBlob, DatabaseListener, ExceptionListenable, TransactionListener, FbWireBlob

public class V10InputBlob extends AbstractFbWireInputBlob implements FbWireBlob, DatabaseListener
Since:
3.0
Author:
Mark Rotteveel
  • Constructor Details

  • Method Details

    • open

      public void open() throws SQLException
      Description copied from interface: FbBlob
      Opens an existing input blob, or creates an output blob.
      Specified by:
      open in interface FbBlob
      Throws:
      SQLException - If the blob is already open, this is a (closed) output blob and it already has a blobId, the transaction is not active, or a database connection error occurred
    • getSegment

      public byte[] getSegment(int sizeRequested) throws SQLException
      Description copied from interface: FbBlob
      Gets a segment of blob data.

      When sizeRequested exceeds FbBlob.getMaximumSegmentSize() it is silently reduced to the maximum segment size.

      TODO: Consider allowing this and have the implementation handle longer segments by sending multiple (batched?) requests.
      Specified by:
      getSegment in interface FbBlob
      Parameters:
      sizeRequested - Requested segment size (> 0).
      Returns:
      Retrieved segment (size may be less than requested)
      Throws:
      SQLException - If this is an output blob, the blob is closed, the transaction is not active, or a database connection error occurred.
    • seek

      public void seek(int offset, FbBlob.SeekMode seekMode) throws SQLException
      Description copied from interface: FbBlob
      Performs a seek on a blob with the specified seekMode and offset.

      Firebird only supports seek on stream blobs.

      Specified by:
      seek in interface FbBlob
      Parameters:
      offset - Offset of the seek, effect depends on value of seekMode
      seekMode - Value of FbBlob.SeekMode
      Throws:
      SQLException - If the blob is closed, the transaction is not active, or a database error occurred.