public class PgBlob extends AbstractBlobClob implements Blob
conn| Constructor and Description |
|---|
PgBlob(BaseConnection conn,
long oid) |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getBinaryStream(long pos,
long length)
Returns an
InputStream object that contains a partial Blob value,
starting with the byte specified by pos, which is length bytes in length. |
int |
setBytes(long pos,
byte[] bytes)
Writes the given array of bytes to the
BLOB value that
this Blob object represents, starting at position
pos, and returns the number of bytes written. |
int |
setBytes(long pos,
byte[] bytes,
int offset,
int len)
Writes all or part of the given
byte array to the
BLOB value that this Blob object represents
and returns the number of bytes written. |
addSubLO, assertPosition, assertPosition, checkFreed, free, getBinaryStream, getBytes, getLo, length, position, position, setBinaryStream, truncateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfree, getBinaryStream, getBytes, length, position, position, setBinaryStream, truncatepublic PgBlob(BaseConnection conn, long oid) throws SQLException
SQLExceptionpublic InputStream getBinaryStream(long pos, long length) throws SQLException
java.sql.BlobInputStream object that contains a partial Blob value,
starting with the byte specified by pos, which is length bytes in length.getBinaryStream in interface Blobpos - the offset to the first byte of the partial value to be retrieved.
The first byte in the Blob is at position 1length - the length in bytes of the partial value to be retrievedInputStream through which the partial Blob value can be read.SQLException - if pos is less than 1 or if pos is greater than the number of bytes
in the Blob or if pos + length is greater than the number of bytes
in the BlobSQLFeatureNotSupportedException - if the JDBC driver does not support
this methodpublic int setBytes(long pos,
byte[] bytes)
throws SQLException
java.sql.BlobBLOB value that
this Blob object represents, starting at position
pos, and returns the number of bytes written.
The array of bytes will overwrite the existing bytes
in the Blob object starting at the position
pos. If the end of the Blob value is reached
while writing the array of bytes, then the length of the Blob
value will be increased to accomodate the extra bytes.
Note: If the value specified for pos
is greater then the length+1 of the BLOB value then the
behavior is undefined. Some JDBC drivers may throw a
SQLException while other drivers may support this
operation.
setBytes in interface Blobpos - the position in the BLOB object at which
to start writing; the first position is 1bytes - the array of bytes to be written to the BLOB
value that this Blob object representsSQLException - if there is an error accessing the
BLOB value or if pos is less than 1SQLFeatureNotSupportedException - if the JDBC driver does not support
this methodBlob.getBytes(long, int)public int setBytes(long pos,
byte[] bytes,
int offset,
int len)
throws SQLException
java.sql.Blobbyte array to the
BLOB value that this Blob object represents
and returns the number of bytes written.
Writing starts at position pos in the BLOB
value; len bytes from the given byte array are written.
The array of bytes will overwrite the existing bytes
in the Blob object starting at the position
pos. If the end of the Blob value is reached
while writing the array of bytes, then the length of the Blob
value will be increased to accomodate the extra bytes.
Note: If the value specified for pos
is greater then the length+1 of the BLOB value then the
behavior is undefined. Some JDBC drivers may throw a
SQLException while other drivers may support this
operation.
setBytes in interface Blobpos - the position in the BLOB object at which
to start writing; the first position is 1bytes - the array of bytes to be written to this BLOB
objectoffset - the offset into the array bytes at which
to start reading the bytes to be setlen - the number of bytes to be written to the BLOB
value from the array of bytes bytesSQLException - if there is an error accessing the
BLOB value or if pos is less than 1SQLFeatureNotSupportedException - if the JDBC driver does not support
this methodBlob.getBytes(long, int)Copyright © 2016 PostgreSQL Global Development Group. All rights reserved.