Class V10InputBlob
java.lang.Object
org.firebirdsql.gds.ng.AbstractFbBlob
org.firebirdsql.gds.ng.wire.AbstractFbWireBlob
org.firebirdsql.gds.ng.wire.AbstractFbWireInputBlob
org.firebirdsql.gds.ng.wire.version10.V10InputBlob
- All Implemented Interfaces:
AutoCloseable,FbBlob,DatabaseListener,ExceptionListenable,TransactionListener,FbWireBlob
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firebirdsql.gds.ng.FbBlob
FbBlob.SeekMode -
Field Summary
Fields inherited from class org.firebirdsql.gds.ng.AbstractFbBlob
exceptionListenerDispatcherFields inherited from interface org.firebirdsql.gds.ng.FbBlob
NO_BLOB_ID -
Constructor Summary
ConstructorsConstructorDescriptionV10InputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getSegment(int sizeRequested) Gets a segment of blob data.voidopen()Opens an existing input blob, or creates an output blob.voidseek(int offset, FbBlob.SeekMode seekMode) Performs a seek on a blob with the specifiedseekModeandoffset.Methods inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireInputBlob
getBlobId, isOutput, putSegmentMethods inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireBlob
cancelImpl, closeImpl, getBlobInfo, getDatabase, getHandle, releaseBlob, releaseResources, setHandleMethods inherited from class org.firebirdsql.gds.ng.AbstractFbBlob
addExceptionListener, cancel, checkBlobClosed, checkBlobOpen, checkDatabaseAttached, checkTransactionActive, clearDatabase, clearTransaction, close, createBlobLengthProcessor, detached, detaching, getBlobInfo, getBlobParameterBuffer, getMaximumSegmentSize, getSynchronizationObject, getTransaction, isEndingTransaction, isEof, isOpen, length, removeExceptionListener, resetEof, setEof, setOpen, transactionStateChanged, warningReceivedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.firebirdsql.gds.ng.listeners.DatabaseListener
detached, detaching, warningReceivedMethods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable
addExceptionListener, removeExceptionListenerMethods inherited from interface org.firebirdsql.gds.ng.FbBlob
cancel, close, getBlobId, getBlobInfo, getBlobInfo, getDatabase, getHandle, getMaximumSegmentSize, getSynchronizationObject, isEof, isOpen, isOutput, length, putSegment
-
Constructor Details
-
V10InputBlob
public V10InputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId)
-
-
Method Details
-
open
Description copied from interface:FbBlobOpens an existing input blob, or creates an output blob.- Specified by:
openin interfaceFbBlob- Throws:
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
Description copied from interface:FbBlobGets a segment of blob data.When
TODO: Consider allowing this and have the implementation handle longer segments by sending multiple (batched?) requests.sizeRequestedexceedsFbBlob.getMaximumSegmentSize()it is silently reduced to the maximum segment size.- Specified by:
getSegmentin interfaceFbBlob- Parameters:
sizeRequested- Requested segment size (> 0).- Returns:
- Retrieved segment (size may be less than requested)
- Throws:
SQLException- If this is an output blob, the blob is closed, the transaction is not active, or a database connection error occurred.
-
seek
Description copied from interface:FbBlobPerforms a seek on a blob with the specifiedseekModeandoffset.Firebird only supports seek on stream blobs.
- Specified by:
seekin interfaceFbBlob- Parameters:
offset- Offset of the seek, effect depends on value ofseekModeseekMode- Value ofFbBlob.SeekMode- Throws:
SQLException- If the blob is closed, the transaction is not active, or a database error occurred.
-