Class JdbcBlob
java.lang.Object
org.h2.message.TraceObject
org.h2.jdbc.JdbcLob
org.h2.jdbc.JdbcBlob
- All Implemented Interfaces:
Blob
-
Nested Class Summary
Nested classes/interfaces inherited from class JdbcLob
JdbcLob.LobPipedOutputStream, JdbcLob.State -
Field Summary
Fields inherited from class TraceObject
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQLXML, STATEMENT, trace, XA_DATA_SOURCE, XID -
Constructor Summary
ConstructorsConstructorDescriptionJdbcBlob(JdbcConnection conn, Value value, JdbcLob.State state, int id) INTERNAL -
Method Summary
Modifier and TypeMethodDescriptionReturns the input stream.getBinaryStream(long pos, long length) Returns the input stream, starting from an offset.byte[]getBytes(long pos, int length) Returns some bytes of the object.longlength()Returns the length.longposition(byte[] pattern, long start) [Not supported] Searches a pattern and return the position.long[Not supported] Searches a pattern and return the position.setBinaryStream(long pos) Get a writer to update the Blob.intsetBytes(long pos, byte[] bytes) Fills the Blob.intsetBytes(long pos, byte[] bytes, int offset, int len) Sets some bytes of the object.voidtruncate(long len) [Not supported] Truncates the object.Methods inherited from class JdbcLob
checkClosed, checkEditable, checkReadable, completeWrite, free, getCharacterStream, setCharacterStreamImpl, setClobOutputStreamImpl, toStringMethods inherited from class TraceObject
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupported
-
Constructor Details
-
JdbcBlob
INTERNAL- Parameters:
conn- it belongs tovalue- ofstate- of the LOBid- of the trace object
-
-
Method Details
-
length
Returns the length.- Specified by:
lengthin interfaceBlob- Returns:
- the length
- Throws:
SQLException
-
truncate
[Not supported] Truncates the object.- Specified by:
truncatein interfaceBlob- Parameters:
len- the new length- Throws:
SQLException
-
getBytes
Returns some bytes of the object.- Specified by:
getBytesin interfaceBlob- Parameters:
pos- the index, the first byte is at position 1length- the number of bytes- Returns:
- the bytes, at most length bytes
- Throws:
SQLException
-
setBytes
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.- Specified by:
setBytesin interfaceBlob- 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
- Throws:
SQLException
-
setBytes
Sets some bytes of the object.- Specified by:
setBytesin interfaceBlob- Parameters:
pos- the write positionbytes- the bytes to setoffset- the bytes offsetlen- the number of bytes to write- Returns:
- how many bytes have been written
- Throws:
SQLException
-
getBinaryStream
Description copied from class:JdbcLobReturns the input stream.- Specified by:
getBinaryStreamin interfaceBlob- Overrides:
getBinaryStreamin classJdbcLob- Returns:
- the input stream
- Throws:
SQLException- on failure
-
setBinaryStream
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.- Specified by:
setBinaryStreamin interfaceBlob- Parameters:
pos- where to start writing (the first byte is at position 1)- Returns:
- an output stream
- Throws:
SQLException
-
position
[Not supported] Searches a pattern and return the position.- Specified by:
positionin interfaceBlob- Parameters:
pattern- the pattern to searchstart- the index, the first byte is at position 1- Returns:
- the position (first byte is at position 1), or -1 for not found
- Throws:
SQLException
-
position
[Not supported] Searches a pattern and return the position.- Specified by:
positionin interfaceBlob- Parameters:
blobPattern- the pattern to searchstart- the index, the first byte is at position 1- Returns:
- the position (first byte is at position 1), or -1 for not found
- Throws:
SQLException
-
getBinaryStream
Returns the input stream, starting from an offset.- Specified by:
getBinaryStreamin interfaceBlob- Parameters:
pos- where to start readinglength- the number of bytes that will be read- Returns:
- the input stream to read
- Throws:
SQLException
-