Java Platform 1.2
Beta 4

Interface java.sql.Blob


public abstract interface Blob
JDBC 2.0

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.


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
 long position(byte[] pattern, long start)
          Determine the byte position at which the given byte pattern
 

Method Detail

length

public long length()
            throws SQLException
The length of the Binary Large OBject in bytes.
Returns:
length of the BLOB in bytes

getBytes

public byte[] getBytes(long pos,
                       int length)
                throws SQLException
Return a copy of the contents of the BLOB at the requested position.
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

getBinaryStream

public InputStream getBinaryStream()
                            throws SQLException
Retrieve the entire BLOB as a stream.
Returns:
a stream containing the BLOB data

position

public long position(byte[] pattern,
                     long start)
              throws SQLException
Determine the byte position at which the given byte pattern
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.

position

public long position(Blob pattern,
                     long start)
              throws SQLException
Determine the byte position at which the given pattern
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.

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.