java.lang.Object
org.firebirdsql.gds.ng.AbstractFbBlob
org.firebirdsql.gds.ng.jna.JnaBlob
- All Implemented Interfaces:
AutoCloseable
,org.firebirdsql.gds.ng.FbBlob
,org.firebirdsql.gds.ng.listeners.DatabaseListener
,org.firebirdsql.gds.ng.listeners.ExceptionListenable
,org.firebirdsql.gds.ng.listeners.TransactionListener
public class JnaBlob
extends org.firebirdsql.gds.ng.AbstractFbBlob
implements org.firebirdsql.gds.ng.FbBlob, org.firebirdsql.gds.ng.listeners.DatabaseListener
Implementation of
FbBlob
for native client access.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firebirdsql.gds.ng.FbBlob
org.firebirdsql.gds.ng.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
ConstructorsConstructorDescriptionJnaBlob
(JnaDatabase database, JnaTransaction transaction, org.firebirdsql.gds.BlobParameterBuffer blobParameterBuffer) Creates a blob for output (writing to the database).JnaBlob
(JnaDatabase database, JnaTransaction transaction, org.firebirdsql.gds.BlobParameterBuffer blobParameterBuffer, long blobId) Creates a blob for input (reading from the database). -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected int
get
(byte[] b, int off, int len, int minLen) final long
byte[]
getBlobInfo
(byte[] requestItems, int bufferLength) int
final com.sun.jna.ptr.IntByReference
byte[]
getSegment
(int sizeRequested) final boolean
isOutput()
void
open()
void
put
(byte[] b, int off, int len) protected void
void
seek
(int offset, org.firebirdsql.gds.ng.FbBlob.SeekMode seekMode) Methods inherited from class org.firebirdsql.gds.ng.AbstractFbBlob
addExceptionListener, cancel, checkBlobClosed, checkBlobOpen, checkDatabaseAttached, checkTransactionActive, clearDatabase, clearTransaction, close, createBlobLengthProcessor, detached, detaching, get, get, getBlobInfo, getBlobParameterBuffer, getMaximumSegmentSize, isEndingTransaction, isEof, isOpen, length, putSegment, 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.DatabaseListener
detached, detaching, warningReceived
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, isEof, isOpen, length, putSegment
-
Constructor Details
-
JnaBlob
public JnaBlob(JnaDatabase database, JnaTransaction transaction, org.firebirdsql.gds.BlobParameterBuffer blobParameterBuffer) Creates a blob for output (writing to the database).- Parameters:
database
- databasetransaction
- transactionblobParameterBuffer
- blob parameter buffer
-
JnaBlob
public JnaBlob(JnaDatabase database, JnaTransaction transaction, org.firebirdsql.gds.BlobParameterBuffer blobParameterBuffer, long blobId) Creates a blob for input (reading from the database).- Parameters:
database
- databasetransaction
- transactionblobParameterBuffer
- blob parameter bufferblobId
- blob id
-
-
Method Details
-
getDatabase
- Specified by:
getDatabase
in interfaceorg.firebirdsql.gds.ng.FbBlob
- Overrides:
getDatabase
in classorg.firebirdsql.gds.ng.AbstractFbBlob
-
getTransaction
- Overrides:
getTransaction
in classorg.firebirdsql.gds.ng.AbstractFbBlob
-
getHandle
public int getHandle()- Specified by:
getHandle
in interfaceorg.firebirdsql.gds.ng.FbBlob
-
getJnaHandle
public final com.sun.jna.ptr.IntByReference getJnaHandle() -
getBlobId
public final long getBlobId()- Specified by:
getBlobId
in interfaceorg.firebirdsql.gds.ng.FbBlob
-
open
- Specified by:
open
in interfaceorg.firebirdsql.gds.ng.FbBlob
- Throws:
SQLException
-
isOutput
public final boolean isOutput()- Specified by:
isOutput
in interfaceorg.firebirdsql.gds.ng.FbBlob
-
getSegment
- Specified by:
getSegment
in interfaceorg.firebirdsql.gds.ng.FbBlob
- Throws:
SQLException
-
get
- Specified by:
get
in classorg.firebirdsql.gds.ng.AbstractFbBlob
- Throws:
SQLException
-
put
- Specified by:
put
in interfaceorg.firebirdsql.gds.ng.FbBlob
- Throws:
SQLException
-
seek
- Specified by:
seek
in interfaceorg.firebirdsql.gds.ng.FbBlob
- Throws:
SQLException
-
getBlobInfo
- Specified by:
getBlobInfo
in interfaceorg.firebirdsql.gds.ng.FbBlob
- Throws:
SQLException
-
closeImpl
- Specified by:
closeImpl
in classorg.firebirdsql.gds.ng.AbstractFbBlob
- Throws:
SQLException
-
cancelImpl
- Specified by:
cancelImpl
in classorg.firebirdsql.gds.ng.AbstractFbBlob
- Throws:
SQLException
-
releaseResources
protected void releaseResources()- Specified by:
releaseResources
in classorg.firebirdsql.gds.ng.AbstractFbBlob
-