public class Blob extends java.lang.Object implements java.sql.Blob, OutputStreamWatcher
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
binaryData
The binary data that makes up this BLOB
|
private ExceptionInterceptor |
exceptionInterceptor |
private boolean |
isClosed |
| Constructor and Description |
|---|
Blob(byte[] data,
ExceptionInterceptor exceptionInterceptor)
Creates a BLOB encapsulating the given binary data
|
Blob(byte[] data,
ResultSetInternalMethods creatorResultSetToSet,
int columnIndexToSet)
Creates an updatable BLOB that can update in-place (not implemented yet).
|
Blob(ExceptionInterceptor exceptionInterceptor)
Creates a Blob without data
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkClosed() |
void |
free() |
private byte[] |
getBinaryData() |
java.io.InputStream |
getBinaryStream() |
java.io.InputStream |
getBinaryStream(long pos,
long length) |
byte[] |
getBytes(long pos,
int length) |
long |
length() |
long |
position(java.sql.Blob pattern,
long start) |
long |
position(byte[] pattern,
long start) |
private void |
setBinaryData(byte[] newBinaryData) |
java.io.OutputStream |
setBinaryStream(long indexToWriteAt) |
int |
setBytes(long writeAt,
byte[] bytes) |
int |
setBytes(long writeAt,
byte[] bytes,
int offset,
int length) |
void |
streamClosed(byte[] byteData) |
void |
streamClosed(WatchableStream out)
Called when the OutputStream being watched has .close() called
|
void |
truncate(long len) |
private byte[] binaryData
private boolean isClosed
private ExceptionInterceptor exceptionInterceptor
Blob(ExceptionInterceptor exceptionInterceptor)
exceptionInterceptor - exception interceptorpublic Blob(byte[] data,
ExceptionInterceptor exceptionInterceptor)
data - data to fill the BlobexceptionInterceptor - exception interceptorBlob(byte[] data,
ResultSetInternalMethods creatorResultSetToSet,
int columnIndexToSet)
data - data to fill the BlobcreatorResultSetToSet - result setcolumnIndexToSet - column indexprivate byte[] getBinaryData()
public java.io.InputStream getBinaryStream()
throws java.sql.SQLException
getBinaryStream in interface java.sql.Blobjava.sql.SQLExceptionpublic byte[] getBytes(long pos,
int length)
throws java.sql.SQLException
getBytes in interface java.sql.Blobjava.sql.SQLExceptionpublic long length()
throws java.sql.SQLException
length in interface java.sql.Blobjava.sql.SQLExceptionpublic long position(byte[] pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobjava.sql.SQLExceptionpublic long position(java.sql.Blob pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobjava.sql.SQLExceptionprivate void setBinaryData(byte[] newBinaryData)
public java.io.OutputStream setBinaryStream(long indexToWriteAt)
throws java.sql.SQLException
setBinaryStream in interface java.sql.Blobjava.sql.SQLExceptionpublic int setBytes(long writeAt,
byte[] bytes)
throws java.sql.SQLException
setBytes in interface java.sql.Blobjava.sql.SQLExceptionpublic int setBytes(long writeAt,
byte[] bytes,
int offset,
int length)
throws java.sql.SQLException
setBytes in interface java.sql.Blobjava.sql.SQLExceptionpublic void streamClosed(byte[] byteData)
public void streamClosed(WatchableStream out)
OutputStreamWatcherstreamClosed in interface OutputStreamWatcherout - WatchableStreampublic void truncate(long len)
throws java.sql.SQLException
truncate in interface java.sql.Blobjava.sql.SQLExceptionpublic void free()
throws java.sql.SQLException
free in interface java.sql.Blobjava.sql.SQLExceptionpublic java.io.InputStream getBinaryStream(long pos,
long length)
throws java.sql.SQLException
getBinaryStream in interface java.sql.Blobjava.sql.SQLExceptionprivate void checkClosed()
throws java.sql.SQLException
java.sql.SQLException