|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Blob
This interface specified methods for accessing a SQL BLOB (Binary Large OBject) type.
Method Summary | |
---|---|
InputStream |
getBinaryStream()
This method returns a stream that will read the bytes of this Blob . |
byte[] |
getBytes(long start,
int count)
This method returns up to the requested bytes of this Blob
as a byte array. |
long |
length()
This method returns the number of bytes in this Blob . |
long |
position(Blob pattern,
long start)
This method returns the index into this Blob at which the
first instance of the specified pattern occurs. |
long |
position(byte[] pattern,
long start)
This method returns the index into this Blob at which the
first instance of the specified bytes occur. |
OutputStream |
setBinaryStream(long start)
Returns a binary stream that writes into this Blob ,
starting at the specified index. |
int |
setBytes(long start,
byte[] bytes)
Writes the specified data into this Blob , starting at the
specified index. |
int |
setBytes(long startWrite,
byte[] bytes,
int startRead,
int count)
Writes a portion of the specified data into this Blob ,
starting at the specified index. |
void |
truncate(long count)
Truncates this Blob to be at most the specified number of
bytes long. |
Method Detail |
---|
long length() throws SQLException
Blob
.
Blob
.
SQLException
- If an error occurs.byte[] getBytes(long start, int count) throws SQLException
Blob
as a byte
array.
start
- The index into this Blob
to start returning
bytes from.count
- The requested number of bytes to return.
Blob
.
SQLException
- If an error occurs.InputStream getBinaryStream() throws SQLException
Blob
.
Blob
.
SQLException
- If an error occurs.long position(byte[] pattern, long start) throws SQLException
Blob
at which the
first instance of the specified bytes occur. The searching starts at the
specified index into this Blob
.
pattern
- The byte pattern to search for.start
- The index into this Blob
to start searching for
the pattern.
SQLException
- If an error occurs.long position(Blob pattern, long start) throws SQLException
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.
pattern
- The Blob
containing the byte pattern to
search for.start
- The index into this Blob
to start searching for
the pattern.
SQLException
- If an error occurs.int setBytes(long start, byte[] bytes) throws SQLException
Blob
, starting at the
specified index.
start
- The index at which the writing starts.bytes
- The data to write.
SQLException
- If an error occurs.int setBytes(long startWrite, byte[] bytes, int startRead, int count) throws SQLException
Blob
,
starting at the specified index.
startWrite
- The index into this Blob
at which writing
starts.bytes
- The data to write a portion of.startRead
- The offset into the data where the portion to copy starts.count
- The number of bytes to write.
SQLException
- If an error occurs.OutputStream setBinaryStream(long start) throws SQLException
Blob
,
starting at the specified index.
start
- The index at which the writing starts.
Blob
.
SQLException
- If an error occurs.void truncate(long count) throws SQLException
Blob
to be at most the specified number of
bytes long.
count
- The length this Blob
is truncated to.
SQLException
- If an error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |