Class JnaBlob

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

    Constructors
    Constructor
    Description
    JnaBlob(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 Type
    Method
    Description
    protected 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
     
    void
     
    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 - database
      transaction - transaction
      blobParameterBuffer - 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 - database
      transaction - transaction
      blobParameterBuffer - blob parameter buffer
      blobId - blob id
  • Method Details

    • getDatabase

      public JnaDatabase getDatabase()
      Specified by:
      getDatabase in interface org.firebirdsql.gds.ng.FbBlob
      Overrides:
      getDatabase in class org.firebirdsql.gds.ng.AbstractFbBlob
    • getTransaction

      public JnaTransaction getTransaction()
      Overrides:
      getTransaction in class org.firebirdsql.gds.ng.AbstractFbBlob
    • getHandle

      public int getHandle()
      Specified by:
      getHandle in interface org.firebirdsql.gds.ng.FbBlob
    • getJnaHandle

      public final com.sun.jna.ptr.IntByReference getJnaHandle()
    • getBlobId

      public final long getBlobId()
      Specified by:
      getBlobId in interface org.firebirdsql.gds.ng.FbBlob
    • open

      public void open() throws SQLException
      Specified by:
      open in interface org.firebirdsql.gds.ng.FbBlob
      Throws:
      SQLException
    • isOutput

      public final boolean isOutput()
      Specified by:
      isOutput in interface org.firebirdsql.gds.ng.FbBlob
    • getSegment

      public byte[] getSegment(int sizeRequested) throws SQLException
      Specified by:
      getSegment in interface org.firebirdsql.gds.ng.FbBlob
      Throws:
      SQLException
    • get

      protected int get(byte[] b, int off, int len, int minLen) throws SQLException
      Specified by:
      get in class org.firebirdsql.gds.ng.AbstractFbBlob
      Throws:
      SQLException
    • put

      public void put(byte[] b, int off, int len) throws SQLException
      Specified by:
      put in interface org.firebirdsql.gds.ng.FbBlob
      Throws:
      SQLException
    • seek

      public void seek(int offset, org.firebirdsql.gds.ng.FbBlob.SeekMode seekMode) throws SQLException
      Specified by:
      seek in interface org.firebirdsql.gds.ng.FbBlob
      Throws:
      SQLException
    • getBlobInfo

      public byte[] getBlobInfo(byte[] requestItems, int bufferLength) throws SQLException
      Specified by:
      getBlobInfo in interface org.firebirdsql.gds.ng.FbBlob
      Throws:
      SQLException
    • closeImpl

      protected void closeImpl() throws SQLException
      Specified by:
      closeImpl in class org.firebirdsql.gds.ng.AbstractFbBlob
      Throws:
      SQLException
    • cancelImpl

      protected void cancelImpl() throws SQLException
      Specified by:
      cancelImpl in class org.firebirdsql.gds.ng.AbstractFbBlob
      Throws:
      SQLException
    • releaseResources

      protected void releaseResources()
      Specified by:
      releaseResources in class org.firebirdsql.gds.ng.AbstractFbBlob