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:
- java.lang.AutoCloseable,- FbBlob,- DatabaseListener,- ExceptionListenable,- TransactionListener,- FbWireBlob
 - Direct Known Subclasses:
- V11InputBlob
 
 public class V10InputBlob extends AbstractFbWireInputBlob implements FbWireBlob, DatabaseListener InputFbWireBlobimplementation for the version 10 wire protocol.- Since:
- 3
- 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 Constructor Description V10InputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intget(byte[] b, int off, int len, int minLen)Default implementation forAbstractFbBlob.get(byte[], int, int)andAbstractFbBlob.get(byte[], int, int, float).byte[]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.protected voidsendGetSegment(int len)Sends theop_get_segmentrequest forlen, without flushing.- 
Methods inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireInputBlobgetBlobId, isOutput, put, putSegment
 - 
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, 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.DatabaseListenerdetached, detaching, warningReceived
 - 
Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenableaddExceptionListener, removeExceptionListener
 - 
Methods inherited from interface org.firebirdsql.gds.ng.FbBlobcancel, close, get, get, getBlobId, getBlobInfo, getBlobInfo, getDatabase, getHandle, getMaximumSegmentSize, isEof, isOpen, isOutput, length, put, putSegment
 
- 
 
- 
- 
- 
Constructor Detail- 
V10InputBlobpublic V10InputBlob(FbWireDatabase database, FbWireTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId) throws java.sql.SQLException - Throws:
- java.sql.SQLException
 
 
- 
 - 
Method Detail- 
openpublic void open() throws java.sql.SQLExceptionDescription copied from interface:FbBlobOpens an existing input blob, or creates an output blob.
 - 
getSegmentpublic byte[] getSegment(int sizeRequested) throws java.sql.SQLExceptionDescription copied from interface:FbBlobGets a segment of blob data.When sizeRequestedexceedsFbBlob.getMaximumSegmentSize()it is silently reduced to the maximum segment size.- Specified by:
- getSegmentin interface- FbBlob
- Parameters:
- sizeRequested- Requested segment size (> 0).
- Returns:
- Retrieved segment (size may be less than requested)
- Throws:
- java.sql.SQLException- If this is an output blob, the blob is closed, the transaction is not active, or a database connection error occurred.
- See Also:
- FbBlob.get(byte[], int, int)
 
 - 
sendGetSegmentprotected void sendGetSegment(int len) throws java.sql.SQLException, java.io.IOExceptionSends theop_get_segmentrequest forlen, without flushing.- Parameters:
- len- requested length (should not exceed- AbstractFbBlob.getMaximumSegmentSize(), but this is not enforced)
- Throws:
- java.sql.SQLException- for errors obtaining the XDR output stream
- java.io.IOException- for errors writing data to the output stream
 
 - 
getprotected int get(byte[] b, int off, int len, int minLen) throws java.sql.SQLExceptionDescription copied from class:AbstractFbBlobDefault implementation forAbstractFbBlob.get(byte[], int, int)andAbstractFbBlob.get(byte[], int, int, float).- Specified by:
- getin class- AbstractFbBlob
- Parameters:
- b- target byte array
- off- offset to start
- len- number of bytes
- minLen- minimum number of bytes to fill (must be- 0 < minLen <= lenif- len != 0
- Returns:
- actual number of bytes read; is 0iflen == 0, will only be less thanminLenif end-of-blob is reached
- Throws:
- java.sql.SQLException- for database access errors, if- off < 0,- len < 0, or if- off + len > b.length, or- len != 0 && (minLen <= 0 || minLen > len)
 
 - 
seekpublic void seek(int offset, FbBlob.SeekMode seekMode) throws java.sql.SQLExceptionDescription copied from interface:FbBlobPerforms a seek on a blob with the specifiedseekModeandoffset.Firebird only supports seek on stream blobs. - Specified by:
- seekin interface- FbBlob
- Parameters:
- offset- Offset of the seek, effect depends on value of- seekMode
- seekMode- Value of- FbBlob.SeekMode
- Throws:
- java.sql.SQLException- If the blob is closed, the transaction is not active, or a database error occurred.
 
 
- 
 
-