public abstract class AbstractBlobClob
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected BaseConnection |
conn |
protected ResourceLock |
lock |
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
protected final ResourceLock lock
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)
Copyright © 2024 PostgreSQL Global Development Group. All rights reserved.