public final class FBCachedBlob extends java.lang.Object implements FirebirdBlob, Synchronizable
FirebirdBlob.BlobInputStream, FirebirdBlob.BlobOutputStream| Constructor and Description |
|---|
FBCachedBlob(byte[] data)
Create an instance using the cached data.
|
| Modifier and Type | Method and Description |
|---|---|
FirebirdBlob |
detach()
Detach this blob.
|
void |
free() |
java.io.InputStream |
getBinaryStream() |
java.io.InputStream |
getBinaryStream(long pos,
long length) |
byte[] |
getBytes(long pos,
int length) |
java.lang.Object |
getSynchronizationObject()
Get synchronization object.
|
boolean |
isSegmented()
Check if blob is segmented.
|
long |
length()
Get the length of the cached blob field.
|
long |
position(java.sql.Blob pattern,
long start)
Find the first entry of the specified pattern.
|
long |
position(byte[] pattern,
long start)
Find the first entry of the specified pattern.
|
java.io.OutputStream |
setBinaryStream(long pos)
Set the contents of blob as binary stream.
|
int |
setBytes(long pos,
byte[] bytes)
Set contents of the blob.
|
int |
setBytes(long pos,
byte[] bytes,
int offset,
int len)
Set the contents of blob.
|
void |
truncate(long length)
Truncate the blob to specified length.
|
public FBCachedBlob(byte[] data)
data - array of bytes containing the cached data.public FirebirdBlob detach() throws java.sql.SQLException
FirebirdBlobNote, detached blob will not remember the stream position of this object. This means that you cannot start reading data from the blob, then detach it, and then continue reading. Reading from detached blob will begin at the blob start.
detach in interface FirebirdBlobFirebirdBlob that is not under result set
control.java.sql.SQLException - if Blob cannot be detached.public boolean isSegmented()
throws java.sql.SQLException
FirebirdBlob.BlobInputStream.seek(int) method.
An instance of FBCachedBlob returns false always.
isSegmented in interface FirebirdBlobtrue if this blob is segmented,
otherwise falsejava.sql.SQLExceptionpublic long length()
throws java.sql.SQLException
length 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 position(byte[] pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobjava.sql.SQLException - always, not yet implemented.public long position(java.sql.Blob pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobjava.sql.SQLException - always, not yet implemented.public java.io.InputStream getBinaryStream()
throws java.sql.SQLException
getBinaryStream 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.SQLExceptionpublic int setBytes(long pos,
byte[] bytes)
throws java.sql.SQLException
setBytes in interface java.sql.Blobjava.sql.SQLException - always, set methods are not relevant in cached state.public int setBytes(long pos,
byte[] bytes,
int offset,
int len)
throws java.sql.SQLException
setBytes in interface java.sql.Blobjava.sql.SQLException - always, set methods are not relevant in cached state.public java.io.OutputStream setBinaryStream(long pos)
throws java.sql.SQLException
setBinaryStream in interface java.sql.Blobjava.sql.SQLException - always, set methods are not relevant in cached state.public void truncate(long length)
throws java.sql.SQLException
truncate in interface java.sql.Blobjava.sql.SQLException - always, truncate is not relevant in cached state.public final java.lang.Object getSynchronizationObject()
SynchronizablegetSynchronizationObject in interface Synchronizablenull.public void free()
throws java.sql.SQLException
free in interface java.sql.Blobjava.sql.SQLExceptionCopyright © 2001-2020 Jaybird (Firebird JDBC/JCA) team. All rights reserved.