Class AbstractFbWireOutputBlob

All Implemented Interfaces:
AutoCloseable, FbBlob, DatabaseListener, ExceptionListenable, TransactionListener, FbWireBlob
Direct Known Subclasses:
V10OutputBlob

public abstract class AbstractFbWireOutputBlob extends AbstractFbWireBlob
Since:
3.0
Author:
Mark Rotteveel
  • Constructor Details

  • Method Details

    • getBlobId

      public final long getBlobId()
      Returns:
      The Firebird blob id
    • setBlobId

      protected final void setBlobId(long blobId) throws SQLException
      Sets the blob id.
      Parameters:
      blobId - Blob id.
      Throws:
      SQLException - If this is an input blob, or if this is an output blob whose blobId was already set.
    • isOutput

      public final boolean isOutput()
      Returns:
      true if this is an output blob (write only), false if this is an input blob (read only)
    • getSegment

      public final 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.

      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.
      See Also:
    • get

      protected final int get(byte[] b, int off, int len, int minLen) throws SQLException
      Description copied from class: AbstractFbBlob
      Specified by:
      get in class AbstractFbBlob
      Parameters:
      b - target byte array
      off - offset to start
      len - number of bytes
      minLen - minimum number of bytes to fill (must be 0 < minLen <= len if len != 0
      Returns:
      actual number of bytes read; is 0 if len == 0, will only be less than minLen if end-of-blob is reached
      Throws:
      SQLException - for database access errors, if off < 0, len < 0, or if off + len > b.length, or len != 0 && (minLen <= 0 || minLen > len)
    • seek

      public final 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.

      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.