public class ConcreteBlob
extends java.lang.Object
implements java.sql.Blob
Modifier and Type | Field and Description |
---|---|
protected byte[] |
_data |
Constructor and Description |
---|
ConcreteBlob()
Constructor
|
ConcreteBlob(int capacity)
Primary Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
free() |
java.io.InputStream |
getBinaryStream()
Get an input stream that can read the BLOB data.
|
java.io.InputStream |
getBinaryStream(long position,
long length) |
byte[] |
getBytes(long position,
int length)
Get the specified part of the blob data as an array of bytes.
|
long |
length()
Get the number of bytes in this BLOB.
|
long |
position(java.sql.Blob pattern,
long start)
Get the position of the first occurence of pattern in this BLOB starting at the position specified by start.
|
long |
position(byte[] pattern,
long start)
Get the position of the first occurence of pattern in this BLOB starting at the position specified by start.
|
java.io.OutputStream |
setBinaryStream(long position)
Get an output stream for writing to this BLOB.
|
int |
setBytes(long position,
byte[] bytes)
Set the specified bytes.
|
int |
setBytes(long position,
byte[] bytes,
int offset,
int length)
Set the specified bytes.
|
void |
truncate(long length)
Truncate this BLOB to be the specified length.
|
public ConcreteBlob(int capacity)
capacity
- The number of bytes allocated for data storage.public ConcreteBlob()
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
getBinaryStream
in interface java.sql.Blob
java.sql.SQLException
public java.io.InputStream getBinaryStream(long position, long length)
getBinaryStream
in interface java.sql.Blob
public void free()
free
in interface java.sql.Blob
public byte[] getBytes(long position, int length)
getBytes
in interface java.sql.Blob
public long length()
length
in interface java.sql.Blob
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
java.sql.SQLException
public long position(byte[] pattern, long start)
position
in interface java.sql.Blob
public java.io.OutputStream setBinaryStream(long position)
setBinaryStream
in interface java.sql.Blob
public int setBytes(long position, byte[] bytes, int offset, int length)
setBytes
in interface java.sql.Blob
public int setBytes(long position, byte[] bytes)
setBytes
in interface java.sql.Blob
public void truncate(long length)
truncate
in interface java.sql.Blob