org.firebirdsql.jdbc
Class FBCachedBlob

java.lang.Object
  extended byorg.firebirdsql.jdbc.FBCachedBlob
All Implemented Interfaces:
java.sql.Blob

public class FBCachedBlob
extends java.lang.Object
implements java.sql.Blob

This class represents a cached blob field.


Constructor Summary
FBCachedBlob(byte[] data)
          Create an instance using the cached data.
 
Method Summary
 java.io.InputStream getBinaryStream()
          Get contents of blob as binary stream.
 byte[] getBytes(long pos, int length)
          Get part of the blob field.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FBCachedBlob

public FBCachedBlob(byte[] data)
Create an instance using the cached data.

Parameters:
data - array of bytes containing the cached data.
Method Detail

length

public long length()
            throws java.sql.SQLException
Get the length of the cached blob field.

Specified by:
length in interface java.sql.Blob
Returns:
length of the cached blob field or -1 if the field is null.
Throws:
java.sql.SQLException

getBytes

public byte[] getBytes(long pos,
                       int length)
                throws java.sql.SQLException
Get part of the blob field.

Specified by:
getBytes in interface java.sql.Blob
Parameters:
pos - starting position to copy.
length - amount of bytes to copy.
Throws:
java.sql.SQLException

position

public long position(byte[] pattern,
                     long start)
              throws java.sql.SQLException
Find the first entry of the specified pattern.

Specified by:
position in interface java.sql.Blob
Throws:
java.sql.SQLException - always, not yet implemented.

position

public long position(java.sql.Blob pattern,
                     long start)
              throws java.sql.SQLException
Find the first entry of the specified pattern.

Specified by:
position in interface java.sql.Blob
Throws:
java.sql.SQLException - always, not yet implemented.

getBinaryStream

public java.io.InputStream getBinaryStream()
                                    throws java.sql.SQLException
Get contents of blob as binary stream.

Specified by:
getBinaryStream in interface java.sql.Blob
Throws:
java.sql.SQLException

setBytes

public int setBytes(long l,
                    byte[] abyte0)
             throws java.sql.SQLException
Set contents of the blob.

Specified by:
setBytes in interface java.sql.Blob
Throws:
java.sql.SQLException - always, set methods are not relevant in cached state.

setBytes

public int setBytes(long l,
                    byte[] abyte0,
                    int i,
                    int j)
             throws java.sql.SQLException
Set the contents of blob.

Specified by:
setBytes in interface java.sql.Blob
Throws:
java.sql.SQLException - always, set methods are not relevant in cached state.

setBinaryStream

public java.io.OutputStream setBinaryStream(long pos)
                                     throws java.sql.SQLException
Set the contents of blob as binary stream.

Specified by:
setBinaryStream in interface java.sql.Blob
Throws:
java.sql.SQLException - always, set methods are not relevant in cached state.

truncate

public void truncate(long length)
              throws java.sql.SQLException
Truncate the blob to specified length.

Specified by:
truncate in interface java.sql.Blob
Throws:
java.sql.SQLException - always, truncate is not relevant in cached state.


Copyright © 2001 David Jencks and other authors. All rights reserved.