Class V10InputBlob

    • Method Detail

      • open

        public void open()
                  throws java.sql.SQLException
        Description copied from interface: FbBlob
        Opens an existing input blob, or creates an output blob.
        Specified by:
        open in interface FbBlob
        Throws:
        java.sql.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 java.sql.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.

        Specified by:
        getSegment in interface FbBlob
        Parameters:
        sizeRequested - Requested segment size (> 0).
        Returns:
        Retrieved segment (size may be less than requested)
        Throws:
        java.sql.SQLException - If this is an output blob, the blob is closed, the transaction is not active, or a database connection error occurred.
        See Also:
        FbBlob.get(byte[], int, int)
      • sendGetSegment

        protected void sendGetSegment​(int len)
                               throws java.sql.SQLException,
                                      java.io.IOException
        Sends the op_get_segment request for len, without flushing.
        Parameters:
        len - requested length (should not exceed AbstractFbBlob.getMaximumSegmentSize(), but this is not enforced)
        Throws:
        java.sql.SQLException - for errors obtaining the XDR output stream
        java.io.IOException - for errors writing data to the output stream
      • get

        protected int get​(byte[] b,
                          int off,
                          int len,
                          int minLen)
                   throws java.sql.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:
        java.sql.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 void seek​(int offset,
                         FbBlob.SeekMode seekMode)
                  throws java.sql.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:
        java.sql.SQLException - If the blob is closed, the transaction is not active, or a database error occurred.