# Blob Represents a BLOB value.
Methods
InputStream | getBinaryStream()
InputStream | getBinaryStream() throws SQLException
InputStream | getBinaryStream(long pos, long length) Returns the input stream, starting from an offset.
InputStream | getBinaryStream(long pos, long length) throws SQLException Returns the input stream, starting from an offset. Parameters: pos - where to start reading length - the number of bytes that will be read Returns: the input stream to read
byte[] | getBytes(long pos, int length) Returns some bytes of the object.
byte[] | getBytes(long pos, int length) throws SQLException Returns some bytes of the object. Parameters: pos - the index, the first byte is at position 1 length - the number of bytes Returns: the bytes, at most length bytes
long | length() Returns the length.
long | length() throws SQLException Returns the length. Returns: the length
long | position(byte[] pattern, long start) [Not supported] Searches a pattern and return the position.
long | position(byte[] pattern, long start) throws SQLException [Not supported] Searches a pattern and return the position. Parameters: pattern - the pattern to search start - the index, the first byte is at position 1 Returns: the position (first byte is at position 1), or -1 for not found
long | position(Blob blobPattern, long start) [Not supported] Searches a pattern and return the position.
long | position(Blob blobPattern, long start) throws SQLException [Not supported] Searches a pattern and return the position. Parameters: blobPattern - the pattern to search start - the index, the first byte is at position 1 Returns: the position (first byte is at position 1), or -1 for not found
OutputStream | setBinaryStream(long pos) Get a writer to update the Blob.
OutputStream | setBinaryStream(long pos) throws SQLException Get a writer to update the Blob. This is only supported for new, empty Blob objects that were created with Connection.createBlob(). The Blob is created in a separate thread, and the object is only updated when OutputStream.close() is called. The position must be 1, meaning the whole Blob data is set. Parameters: pos - where to start writing (the first byte is at position 1) Returns: an output stream
int | setBytes(long pos, byte[] bytes) Fills the Blob.
int | setBytes(long pos, byte[] bytes) throws SQLException Fills the Blob. This is only supported for new, empty Blob objects that were created with Connection.createBlob(). The position must be 1, meaning the whole Blob data is set. Parameters: pos - where to start writing (the first byte is at position 1) bytes - the bytes to set Returns: the length of the added data
int | setBytes(long pos, byte[] bytes, int offset, int len) Sets some bytes of the object.
int | setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException Sets some bytes of the object. Parameters: pos - the write position bytes - the bytes to set offset - the bytes offset len - the number of bytes to write Returns: how many bytes have been written
void | truncate(long len) [Not supported] Truncates the object.
void | truncate(long len) throws SQLException [Not supported] Truncates the object. Parameters: len - the new length