public abstract int setBytes (long pos, byte[] bytes, int offset, int len) throws SQLException

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. 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.

Parameters:
pos    the position in the BLOB object at which to start writing; the first position is 1
bytes    the array of bytes to be written to this BLOB object
offset    the offset into the array bytes at which to start reading the bytes to be set
len    the number of bytes to be written to the BLOB value from the array of bytes bytes

Returns:  the number of bytes written

Exceptions:
SQLException    if there is an error accessing the BLOB value or if pos is less than 1
SQLFeatureNotSupportedException    if the JDBC driver does not support this method

See also:
getBytes

Since:  1.4