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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addSubLO
(LargeObject subLO) protected void
assertPosition
(long pos) Throws an exception if the pos value exceeds the max value by which the large object API can index.protected void
assertPosition
(long pos, long len) Throws an exception if the pos value exceeds the max value by which the large object API can index.protected void
Checks that this LOB hasn't been free()d already.void
free()
byte[]
getBytes
(long pos, int length) protected LargeObject
getLo
(boolean forWrite) long
length()
long
position
(byte[] pattern, long start) Iterate over the buffer looking for the specified pattern.long
This is simply passing the byte value of the pattern Blob.setBinaryStream
(long pos) void
truncate
(long len) For Blobs this should be in bytes while for Clobs it should be in characters.
-
Field Details
-
conn
-
-
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
-