public 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()
Get contents of blob as binary stream.
|
java.io.InputStream |
getBinaryStream(long pos,
long length) |
byte[] |
getBytes(long pos,
int length)
Get part of the blob field.
|
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 l,
byte[] abyte0)
Set contents of the blob.
|
int |
setBytes(long l,
byte[] abyte0,
int i,
int j)
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
FirebirdBlobFirebirdBlob.BlobInputStream.seek(int) method.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.Blobpos - starting position to copy.length - amount of bytes to copy.java.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 int setBytes(long l,
byte[] abyte0)
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 l,
byte[] abyte0,
int i,
int j)
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.BlobsetBinaryStream in interface FirebirdBlobpos - the position in the BLOB value at which
to start writing; currently only position 0 is supported.java.io.OutputStream object to which data can
be writtenjava.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.SQLExceptionpublic java.io.InputStream getBinaryStream(long pos,
long length)
throws java.sql.SQLException
getBinaryStream in interface java.sql.Blobjava.sql.SQLExceptionCopyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.