java.sql
Interface Blob
java.lang.Object
|
+--java.sql.Blob
public interface Blob
This interface specified methods for accessing a SQL BLOB (Binary
Large OBject) type.
Since:Author:- Aaron M. Renn (arenn@urbanophile.com)
getBinaryStream
public InputStream getBinaryStream()
This method returns a stream that will read the bytes of the BLOB.
Returns:
- A stream that will read the bytes of the BLOB.
Throws:
getBytes
public byte[] getBytes(long pos, int length)
This method returns up to the requested bytes of this BLOB as a
byte
array.
Parameters:
Returns:
- The requested bytes from the BLOB.
Throws:
length
public long length()
This method returns the number of bytes in the BLOB.
Returns:
- The number of bytes in the BLOB.
Throws:
position
public long position(byte[] pattern, long start)
This method returns the index into the BLOB at which the first instance
of the specified bytes occur. The searching starts at the specified
index into the BLOB.
Parameters:
Returns:
- The offset at which the pattern is first found, or -1 if the
pattern is not found.
Throws:
position
public long position(java.sql.Blob pattern, long start)
This method returns the index into the BLOB at which the first instance
of the specified pattern occurs. The searching starts at the specified
index into this BLOB. The bytes in the specified Blob
are
used as the search pattern.
Parameters:
Returns:
- The offset at which the pattern is first found, or -1 if the
pattern is not found.
Throws:
setBinaryStream
public OutputStream setBinaryStream(long pos)
Since:Parameters:
Throws:
setBytes
public int setBytes(long pos, byte[] bytes)
Since:Parameters:
Throws:
setBytes
public int setBytes(long pos, byte[] bytes, int offset, int len)
Since:Parameters:
Throws:
truncate
public void truncate(long len)
Since:Parameters:
Throws: