1.50.39

interbase.interclient
Class Blob

java.lang.Object
  |
  +--interbase.interclient.Blob

public final class Blob
extends Object
implements Blob

Represents an SQL 3 Binary Large Object (BLOb). By default, a Blob is a transaction duration reference to a binary large object. By default, a Blob is implemented using a LOCATOR(blob) internally.

Since:
JDBC 2, not yet supported

Method Summary
 InputStream getBinaryStream()
          Retrieve the entire BLOB as a stream.
 byte[] getBytes(long pos, int length)
          Return a copy of the contents of the BLOB at the requested position.
 long length()
          The length of the Binary Large OBject in bytes.
 long position(Blob pattern, long start)
          Determine the byte position at which the given pattern pattern starts in the BLOB.
 long position(byte[] pattern, long start)
          Determine the byte position at which the given byte pattern starts in the BLOB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

length

public long length()
            throws SQLException
The length of the Binary Large OBject in bytes.
Specified by:
length in interface Blob
Returns:
length of the BLOB in bytes
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getBytes

public byte[] getBytes(long pos,
                       int length)
                throws SQLException
Return a copy of the contents of the BLOB at the requested position.
Specified by:
getBytes in interface Blob
Parameters:
pos - is the first byte of the blob to be extracted.
length - is the number of consecutive bytes to be copied.
Returns:
a byte array containing a portion of the BLOB
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getBinaryStream

public InputStream getBinaryStream()
                            throws SQLException
Retrieve the entire BLOB as a stream.
Specified by:
getBinaryStream in interface Blob
Returns:
a stream containing the BLOB data
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

position

public long position(byte[] pattern,
                     long start)
              throws SQLException
Determine the byte position at which the given byte pattern starts in the BLOB. Begin search at position start. Return -1 if the pattern does not appear in the BLOB.
Specified by:
position in interface Blob
Parameters:
pattern - is the pattern to search for.
start - is the position at which to begin searching.
Returns:
the position at which the pattern appears, else -1.
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

position

public long position(Blob pattern,
                     long start)
              throws SQLException
Determine the byte position at which the given pattern pattern starts in the BLOB. Begin search at position start. Return -1 if the pattern does not appear in the BLOB.
Specified by:
position in interface Blob
Parameters:
searchstr - is the pattern to search for.
start - is the position at which to begin searching.
Returns:
the position at which the pattern appears, else -1.
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

1.50.39

Send comments or suggestions to icsupport@interbase.com