Package org.postgresql.jdbc
Class AbstractBlobClob
java.lang.Object
org.postgresql.jdbc.AbstractBlobClob
This class holds all of the methods common to both Blobs and Clobs.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddSubLO(LargeObject subLO) protected voidassertPosition(long pos) Throws an exception if the pos value exceeds the max value by which the large object API can index.protected voidassertPosition(long pos, long len) Throws an exception if the pos value exceeds the max value by which the large object API can index.protected voidChecks that this LOB hasn't been free()d already.voidfree()byte[]getBytes(long pos, int length) protected LargeObjectgetLo(boolean forWrite) longlength()longposition(byte[] pattern, long start) Iterate over the buffer looking for the specified pattern.longThis is simply passing the byte value of the pattern Blob.setBinaryStream(long pos) voidtruncate(long len) For Blobs this should be in bytes while for Clobs it should be in characters.
-
Field Details
-
conn
-
lock
-
-
Constructor Details
-
AbstractBlobClob
- Throws:
SQLException
-
-
Method Details
-
free
- Throws:
SQLException
-
truncate
For Blobs this should be in bytes while for Clobs it should be in characters. Since we really haven't figured out how to handle character sets for Clobs the current implementation uses bytes for both Blobs and Clobs.- Parameters:
len- maximum length- Throws:
SQLException- if operation fails
-
length
- Throws:
SQLException
-
getBytes
- Throws:
SQLException
-
getBinaryStream
- Throws:
SQLException
-
setBinaryStream
- Throws:
SQLException
-
position
Iterate over the buffer looking for the specified pattern.- Parameters:
pattern- A pattern of bytes to search the blob forstart- The position to start reading from- Returns:
- position of the specified pattern
- Throws:
SQLException- if something wrong happens
-
position
This is simply passing the byte value of the pattern Blob.- Parameters:
pattern- search patternstart- start position- Returns:
- position of given pattern
- Throws:
SQLException- if something goes wrong
-
assertPosition
Throws an exception if the pos value exceeds the max value by which the large object API can index.- Parameters:
pos- Position to write at.- Throws:
SQLException- if something goes wrong
-
assertPosition
Throws an exception if the pos value exceeds the max value by which the large object API can index.- Parameters:
pos- Position to write at.len- number of bytes to write.- Throws:
SQLException- if something goes wrong
-
checkFreed
Checks that this LOB hasn't been free()d already.- Throws:
SQLException- if LOB has been freed.
-
getLo
- Throws:
SQLException
-
addSubLO
-