Class AbstractFbWireInputBlob
- java.lang.Object
- 
- org.firebirdsql.gds.ng.AbstractFbBlob
- 
- org.firebirdsql.gds.ng.wire.AbstractFbWireBlob
- 
- org.firebirdsql.gds.ng.wire.AbstractFbWireInputBlob
 
 
 
- 
- All Implemented Interfaces:
- java.lang.AutoCloseable,- FbBlob,- DatabaseListener,- ExceptionListenable,- TransactionListener,- FbWireBlob
 - Direct Known Subclasses:
- V10InputBlob
 
 public abstract class AbstractFbWireInputBlob extends AbstractFbWireBlob - Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireBlobAbstractFbWireBlob.BlobOpenOperation
 - 
Nested classes/interfaces inherited from class org.firebirdsql.gds.ng.AbstractFbBlobAbstractFbBlob.BlobState
 - 
Nested classes/interfaces inherited from interface org.firebirdsql.gds.ng.FbBlobFbBlob.SeekMode
 
- 
 - 
Field Summary- 
Fields inherited from class org.firebirdsql.gds.ng.AbstractFbBlobexceptionListenerDispatcher
 - 
Fields inherited from interface org.firebirdsql.gds.ng.FbBlobNO_BLOB_ID
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractFbWireInputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetBlobId()Returns the blob id.booleanisOutput()voidput(byte[] b, int off, int len)Writes content ofbstarting atoffforlengthbytes to the blob.voidputSegment(byte[] segment)Writes a segment of blob data.- 
Methods inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireBlobcancelImpl, closeImpl, getBlobInfo, getDatabase, getHandle, getXdrIn, getXdrOut, processOpenResponse, receiveOpenResponse, releaseBlob, releaseResources, sendOpen, setHandle, wrapDeferredResponse
 - 
Methods inherited from class org.firebirdsql.gds.ng.AbstractFbBlobaddExceptionListener, 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, warningReceived, withLock
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenableaddExceptionListener, removeExceptionListener
 - 
Methods inherited from interface org.firebirdsql.gds.ng.FbBlobcancel, close, get, get, getBlobInfo, getMaximumSegmentSize, getSegment, isEof, isOpen, length, open, seek
 
- 
 
- 
- 
- 
Constructor Detail- 
AbstractFbWireInputBlobprotected AbstractFbWireInputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId) throws java.sql.SQLException - Throws:
- java.sql.SQLException
 
 
- 
 - 
Method Detail- 
getBlobIdpublic final long getBlobId() Description copied from interface:FbBlobReturns the blob id.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 valueFbBlob.NO_BLOB_IDis technically invalid, but Firebird will handle it as an empty blob (both for input and output).- Returns:
- The Firebird blob id
 
 - 
isOutputpublic final boolean isOutput() - Returns:
- trueif this is an output blob (write only),- falseif this is an input blob (read only)
 
 - 
putSegmentpublic final void putSegment(byte[] segment) throws java.sql.SQLExceptionDescription copied from interface:FbBlobWrites 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:
- putSegmentin interface- FbBlob
- Overrides:
- putSegmentin class- AbstractFbBlob
- Parameters:
- segment- segment to write
- Throws:
- java.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 occurred
- See Also:
- FbBlob.put(byte[], int, int)
 
 - 
putpublic final void put(byte[] b, int off, int len) throws java.sql.SQLExceptionDescription copied from interface:FbBlobWrites content ofbstarting atoffforlengthbytes 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 array
- off- offset to start
- len- number of bytes
- Throws:
- java.sql.SQLException- for database access errors, if- off < 0,- len < 0, or if- off + len > b.length
 
 
- 
 
-