public class V10InputBlob extends AbstractFbWireInputBlob implements FbWireBlob, DatabaseListener
FbWireBlob
implementation for the version 10 wire protocol.AbstractFbWireBlob.BlobOpenOperation
AbstractFbBlob.BlobState
FbBlob.SeekMode
exceptionListenerDispatcher
NO_BLOB_ID
Constructor and Description |
---|
V10InputBlob(FbWireDatabase database,
FbWireTransaction transaction,
BlobParameterBuffer blobParameterBuffer,
long blobId) |
Modifier and Type | Method and Description |
---|---|
protected int |
get(byte[] b,
int off,
int len,
int minLen)
Default implementation for
AbstractFbBlob.get(byte[], int, int) and AbstractFbBlob.get(byte[], int, int, float) . |
byte[] |
getSegment(int sizeRequested)
Gets a segment of blob data.
|
void |
open()
Opens an existing input blob, or creates an output blob.
|
void |
seek(int offset,
FbBlob.SeekMode seekMode)
Performs a seek on a blob with the specified
seekMode and offset . |
protected void |
sendGetSegment(int len)
Sends the
op_get_segment request for len , without flushing. |
getBlobId, isOutput, put, putSegment
cancelImpl, closeImpl, getBlobInfo, getDatabase, getHandle, getXdrIn, getXdrOut, processOpenResponse, receiveOpenResponse, releaseBlob, releaseResources, sendOpen, setHandle, wrapDeferredResponse
addExceptionListener, cancel, checkBlobClosed, checkBlobOpen, checkDatabaseAttached, checkTransactionActive, clearDatabase, clearDeferredException, clearTransaction, close, createBlobLengthProcessor, detached, detaching, errorOccurred, get, get, getBlobInfo, getBlobParameterBuffer, getKnownBlobInfoItems, getMaximumSegmentSize, getState, getTransaction, isEndingTransaction, isEof, isOpen, length, registerDeferredException, removeExceptionListener, resetEof, setEof, setState, throwAndClearDeferredException, transactionStateChanged, transferDeferredExceptionTo, validateBufferLength, warningReceived, withLock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel, close, get, get, getBlobId, getBlobInfo, getBlobInfo, getDatabase, getHandle, getMaximumSegmentSize, isEof, isOpen, isOutput, length, put, putSegment
addExceptionListener, removeExceptionListener
detached, detaching, warningReceived
public V10InputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId) throws java.sql.SQLException
java.sql.SQLException
public void open() throws java.sql.SQLException
FbBlob
public byte[] getSegment(int sizeRequested) throws java.sql.SQLException
FbBlob
When sizeRequested
exceeds FbBlob.getMaximumSegmentSize()
it is silently reduced to the maximum
segment size.
getSegment
in interface FbBlob
sizeRequested
- Requested segment size (> 0).java.sql.SQLException
- If this is an output blob, the blob is closed, the transaction is not active, or a database connection
error occurred.FbBlob.get(byte[], int, int)
protected void sendGetSegment(int len) throws java.sql.SQLException, java.io.IOException
op_get_segment
request for len
, without flushing.len
- requested length (should not exceed AbstractFbBlob.getMaximumSegmentSize()
, but this is not enforced)java.sql.SQLException
- for errors obtaining the XDR output streamjava.io.IOException
- for errors writing data to the output streamprotected int get(byte[] b, int off, int len, int minLen) throws java.sql.SQLException
AbstractFbBlob
AbstractFbBlob.get(byte[], int, int)
and AbstractFbBlob.get(byte[], int, int, float)
.get
in class AbstractFbBlob
b
- target byte arrayoff
- offset to startlen
- number of bytesminLen
- minimum number of bytes to fill (must be 0 < minLen <= len
if len != 0
0
if len == 0
, will only be less than minLen
if
end-of-blob is reachedjava.sql.SQLException
- for database access errors, if off < 0
, len < 0
, or if off + len > b.length
,
or len != 0 && (minLen <= 0 || minLen > len)
public void seek(int offset, FbBlob.SeekMode seekMode) throws java.sql.SQLException
FbBlob
seekMode
and offset
.
Firebird only supports seek on stream blobs.
seek
in interface FbBlob
offset
- Offset of the seek, effect depends on value of seekMode
seekMode
- Value of FbBlob.SeekMode
java.sql.SQLException
- If the blob is closed, the transaction is not active, or a database error occurred.Copyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.