public abstract class AbstractFbWireOutputBlob extends AbstractFbWireBlob
AbstractFbWireBlob.BlobOpenOperation
AbstractFbBlob.BlobState
FbBlob.SeekMode
exceptionListenerDispatcher
NO_BLOB_ID
Modifier | Constructor and Description |
---|---|
protected |
AbstractFbWireOutputBlob(FbWireDatabase database,
FbWireTransaction transaction,
BlobParameterBuffer blobParameterBuffer) |
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) . |
long |
getBlobId()
Returns the blob id.
|
byte[] |
getSegment(int sizeRequested)
Gets a segment of blob data.
|
boolean |
isOutput() |
protected void |
processOpenResponse(GenericResponse genericResponse) |
void |
seek(int offset,
FbBlob.SeekMode seekMode)
Performs a seek on a blob with the specified
seekMode and offset . |
protected void |
setBlobId(long blobId)
Sets the blob id.
|
cancelImpl, closeImpl, getBlobInfo, getDatabase, getHandle, getXdrIn, getXdrOut, 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, putSegment, 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, isEof, isOpen, length, open, put, putSegment
addExceptionListener, removeExceptionListener
protected AbstractFbWireOutputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer) 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).
protected final void setBlobId(long blobId) throws java.sql.SQLException
blobId
- Blob id.java.sql.SQLException
- If this is an input blob, or if this is an output blob whose blobId was already set.protected void processOpenResponse(GenericResponse genericResponse) throws java.sql.SQLException
processOpenResponse
in class AbstractFbWireBlob
java.sql.SQLException
public final boolean isOutput()
true
if this is an output blob (write only), false
if this is an
input blob (read only)public final byte[] getSegment(int sizeRequested) throws java.sql.SQLException
FbBlob
When sizeRequested
exceeds FbBlob.getMaximumSegmentSize()
it is silently reduced to the maximum
segment size.
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 final 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 final void seek(int offset, FbBlob.SeekMode seekMode) throws java.sql.SQLException
FbBlob
seekMode
and offset
.
Firebird only supports seek on stream blobs.
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.