Modifier and Type | Class and Description |
---|---|
private class |
AbstractBlobClob.LOIterator
Iterates over a large object returning byte values.
|
Modifier and Type | Field and Description |
---|---|
protected BaseConnection |
conn |
private LargeObject |
currentLo |
private boolean |
currentLoIsWriteable |
private long |
oid |
private java.util.ArrayList<LargeObject> |
subLOs
We create separate LargeObjects for methods that use streams so they won't interfere with each
other.
|
private boolean |
support64bit |
Constructor and Description |
---|
AbstractBlobClob(BaseConnection conn,
long oid) |
Modifier and Type | Method and Description |
---|---|
protected 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 |
checkFreed()
Checks that this LOB hasn't been free()d already.
|
void |
free() |
java.io.InputStream |
getBinaryStream() |
byte[] |
getBytes(long pos,
int length) |
protected LargeObject |
getLo(boolean forWrite) |
long |
length() |
long |
position(java.sql.Blob pattern,
long start)
This is simply passing the byte value of the pattern Blob.
|
long |
position(byte[] pattern,
long start)
Iterate over the buffer looking for the specified pattern.
|
java.io.OutputStream |
setBinaryStream(long pos) |
void |
truncate(long len)
For Blobs this should be in bytes while for Clobs it should be in characters.
|
protected BaseConnection conn
private LargeObject currentLo
private boolean currentLoIsWriteable
private boolean support64bit
private java.util.ArrayList<LargeObject> subLOs
private final long oid
public AbstractBlobClob(BaseConnection conn, long oid) throws java.sql.SQLException
java.sql.SQLException
public void free() throws java.sql.SQLException
java.sql.SQLException
public void truncate(long len) throws java.sql.SQLException
len
- maximum lengthjava.sql.SQLException
- if operation failspublic long length() throws java.sql.SQLException
java.sql.SQLException
public byte[] getBytes(long pos, int length) throws java.sql.SQLException
java.sql.SQLException
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
java.sql.SQLException
public java.io.OutputStream setBinaryStream(long pos) throws java.sql.SQLException
java.sql.SQLException
public long position(byte[] pattern, long start) throws java.sql.SQLException
pattern
- A pattern of bytes to search the blob forstart
- The position to start reading fromjava.sql.SQLException
- if something wrong happenspublic long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
pattern
- search patternstart
- start positionjava.sql.SQLException
- if something goes wrongprotected void assertPosition(long pos) throws java.sql.SQLException
pos
- Position to write at.java.sql.SQLException
- if something goes wrongprotected void assertPosition(long pos, long len) throws java.sql.SQLException
pos
- Position to write at.len
- number of bytes to write.java.sql.SQLException
- if something goes wrongprotected void checkFreed() throws java.sql.SQLException
java.sql.SQLException
- if LOB has been freed.protected LargeObject getLo(boolean forWrite) throws java.sql.SQLException
java.sql.SQLException
protected void addSubLO(LargeObject subLO)