public abstract class AbstractFbWireInputBlob extends AbstractFbWireBlob
AbstractFbWireBlob.BlobOpenOperation
AbstractFbBlob.BlobState
FbBlob.SeekMode
exceptionListenerDispatcher
NO_BLOB_ID
Modifier | Constructor and Description |
---|---|
protected |
AbstractFbWireInputBlob(FbWireDatabase database,
FbWireTransaction transaction,
BlobParameterBuffer blobParameterBuffer,
long blobId) |
Modifier and Type | Method and Description |
---|---|
long |
getBlobId()
Returns the blob id.
|
boolean |
isOutput() |
void |
put(byte[] b,
int off,
int len)
Writes content of
b starting at off for length bytes to the blob. |
void |
putSegment(byte[] segment)
Writes a segment of blob data.
|
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, 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, getBlobInfo, getMaximumSegmentSize, getSegment, isEof, isOpen, length, open, seek
addExceptionListener, removeExceptionListener
protected AbstractFbWireInputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId) throws java.sql.SQLException
java.sql.SQLException
public final long getBlobId()
FbBlob
For output blobs, this will return FbBlob.NO_BLOB_ID
(0L
) if the blob wasn't opened yet, or if the blob
is deferred opened (client-side only). The value FbBlob.NO_BLOB_ID
is technically invalid, but Firebird will
handle it as an empty blob (both for input and output).
public final boolean isOutput()
true
if this is an output blob (write only), false
if this is an
input blob (read only)public final void putSegment(byte[] segment) throws java.sql.SQLException
FbBlob
Implementations must handle segment lengths exceeding FbBlob.getMaximumSegmentSize()
by batching. This method
should either call put(segment, 0, segment.length)
, or produce the same effects as that call.
Passing a section that is length 0 will throw an SQLException
.
putSegment
in interface FbBlob
putSegment
in class AbstractFbBlob
segment
- segment to writejava.sql.SQLException
- if this is an input blob, the blob is closed, the transaction is not active, the segment is length 0, or
a database connection error occurredFbBlob.put(byte[], int, int)
public final void put(byte[] b, int off, int len) throws java.sql.SQLException
FbBlob
b
starting at off
for length
bytes to the blob.
Implementations must write all bytes to the blob, using multiple round-trips if necessary.
If the implementation cannot perform writes without additional allocation, it should use at most
DatabaseConnectionProperties.getBlobBufferSize()
as an internal buffer. If the implementation can
perform writes without additional allocation, it is recommended it performs reads using (at most)
FbBlob.getMaximumSegmentSize()
.
b
- source byte arrayoff
- offset to startlen
- number of bytesjava.sql.SQLException
- for database access errors, if off < 0
, len < 0
, or if off + len > b.length
Copyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.