java.lang.Object
org.firebirdsql.gds.ng.AbstractFbBlob
org.firebirdsql.gds.ng.wire.AbstractFbWireBlob
org.firebirdsql.gds.ng.wire.AbstractFbWireInputBlob
- All Implemented Interfaces:
AutoCloseable
,FbBlob
,DatabaseListener
,ExceptionListenable
,TransactionListener
,FbWireBlob
- Direct Known Subclasses:
V10InputBlob
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Nested Class Summary
Nested classes/interfaces inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireBlob
AbstractFbWireBlob.BlobOpenOperation
Nested classes/interfaces inherited from interface org.firebirdsql.gds.ng.FbBlob
FbBlob.SeekMode
-
Field Summary
Fields inherited from class org.firebirdsql.gds.ng.AbstractFbBlob
exceptionListenerDispatcher
Fields inherited from interface org.firebirdsql.gds.ng.FbBlob
NO_BLOB_ID
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractFbWireInputBlob
(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId) -
Method Summary
Modifier and TypeMethodDescriptionfinal long
final boolean
isOutput()
final void
put
(byte[] b, int off, int len) Writes content ofb
starting atoff
forlength
bytes to the blob.final void
putSegment
(byte[] segment) Writes a segment of blob data.Methods inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireBlob
cancelImpl, closeImpl, getBlobInfo, getDatabase, getHandle, getXdrIn, getXdrOut, releaseBlob, releaseResources, sendOpen, setHandle
Methods inherited from class org.firebirdsql.gds.ng.AbstractFbBlob
addExceptionListener, cancel, checkBlobClosed, checkBlobOpen, checkDatabaseAttached, checkTransactionActive, clearDatabase, clearTransaction, close, createBlobLengthProcessor, detached, detaching, get, get, get, getBlobInfo, getBlobParameterBuffer, getMaximumSegmentSize, getTransaction, isEndingTransaction, isEof, isOpen, length, removeExceptionListener, resetEof, setEof, setOpen, transactionStateChanged, validateBufferLength, warningReceived, withLock
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable
addExceptionListener, removeExceptionListener
Methods inherited from interface org.firebirdsql.gds.ng.FbBlob
cancel, close, get, get, getBlobInfo, getMaximumSegmentSize, getSegment, isEof, isOpen, length, open, seek
-
Constructor Details
-
AbstractFbWireInputBlob
protected AbstractFbWireInputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId)
-
-
Method Details
-
getBlobId
public final long getBlobId()- Returns:
- The Firebird blob id
-
isOutput
public final boolean isOutput()- Returns:
true
if this is an output blob (write only),false
if this is an input blob (read only)
-
putSegment
Description copied from interface:FbBlob
Writes a segment of blob data.Implementations must handle segment lengths exceeding
FbBlob.getMaximumSegmentSize()
by batching. This method should either callput(segment, 0, segment.length)
, or produce the same effects as that call.Passing a section that is length 0 will throw an
SQLException
.- Specified by:
putSegment
in interfaceFbBlob
- Overrides:
putSegment
in classAbstractFbBlob
- Parameters:
segment
- segment to write- Throws:
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 occurred- See Also:
-
put
Description copied from interface:FbBlob
Writes content ofb
starting atoff
forlength
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()
.- Parameters:
b
- source byte arrayoff
- offset to startlen
- number of bytes- Throws:
SQLException
- for database access errors, ifoff < 0
,len < 0
, or ifoff + len > b.length
-