|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.AS400JDBCBlob
The AS400JDBCBlob class provides access to binary large objects. The data is valid only within the current transaction.
Method Summary | |
java.io.InputStream |
getBinaryStream()
Returns the entire BLOB as a stream of uninterpreted bytes. |
byte[] |
getBytes(long start,
int length)
Returns part of the contents of the BLOB. |
long |
length()
Returns the length of the BLOB. |
long |
position(java.sql.Blob pattern,
long start)
Returns the position at which a pattern is found in the BLOB. |
long |
position(byte[] pattern,
long start)
Returns the position at which a pattern is found in the BLOB. |
java.io.OutputStream |
setBinaryStream(long positionToStartWriting)
Returns a stream that an application can use to write to this BLOB. |
int |
setBytes(long positionToStartWriting,
byte[] bytesToWrite)
Writes an array of bytes to this BLOB, starting at position positionToStartWriting in the BLOB. |
int |
setBytes(long positionToStartWriting,
byte[] bytesToWrite,
int offset,
int lengthOfWrite)
Writes all or part of the byte array the application passes in to this BLOB, starting at position positionToStartWriting in the BLOB. |
void |
truncate(long lengthOfBLOB)
Truncates this BLOB to a length of lengthOfBLOB bytes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
getBinaryStream
in interface java.sql.Blob
java.sql.SQLException
- If an error occurs.public byte[] getBytes(long start, int length) throws java.sql.SQLException
getBytes
in interface java.sql.Blob
start
- The start position within the BLOB (1-based).length
- The length to return.java.sql.SQLException
- If the start position is not valid,
if the length is not valid,
or an error occurs.public long length() throws java.sql.SQLException
length
in interface java.sql.Blob
java.sql.SQLException
- If an error occurs.public long position(byte[] pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
pattern
- The pattern.start
- The position within the BLOB to begin
searching (1-based).java.sql.SQLException
- If the pattern is null,
the position is not valid,
or an error occurs.public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
pattern
- The pattern.start
- The position within the BLOB to begin
searching (1-based).java.sql.SQLException
- If the pattern is null,
the position is not valid,
or an error occurs.public java.io.OutputStream setBinaryStream(long positionToStartWriting) throws java.sql.SQLException
positionToStartWriting
- The position (1-based) in the BLOB where writes should start.java.sql.SQLException
- If there is an error accessing the BLOB or if the position
specified is greater than the length of the BLOB.public int setBytes(long positionToStartWriting, byte[] bytesToWrite) throws java.sql.SQLException
positionToStartWriting
- The position (1-based) in the BLOB where writes should start.bytesToWrite
- The array of bytes to be written to this BLOB.java.sql.SQLException
- If there is an error accessing the BLOB or if the position
specified is greater than the length of the BLOB.public int setBytes(long positionToStartWriting, byte[] bytesToWrite, int offset, int lengthOfWrite) throws java.sql.SQLException
positionToStartWriting
- The position (1-based) in the BLOB where writes should start.bytesToWrite
- The array of bytes to be written to this BLOB.offset
- The offset into the array bytes at which to start reading the bytes
(1-based).length
- The number of bytes to be written to the BLOB from the array of bytes.java.sql.SQLException
- If there is an error accessing the BLOB or if the position
specified is greater than the length of the BLOB.public void truncate(long lengthOfBLOB) throws java.sql.SQLException
lengthOfBLOB
- The length, in bytes, that this BLOB should be after
truncation.java.sql.SQLException
- If there is an error accessing the BLOB or if the length
specified is greater than the length of the BLOB.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |