org.hibernate.lob
Class BlobImpl

java.lang.Object
  extended byorg.hibernate.lob.BlobImpl
All Implemented Interfaces:
Blob

public class BlobImpl
extends Object
implements Blob

A dummy implementation of java.sql.Blob that may be used to insert new data into a BLOB.

Author:
Gavin King

Constructor Summary
BlobImpl(byte[] bytes)
           
BlobImpl(InputStream stream, int length)
           
 
Method Summary
 InputStream getBinaryStream()
           
 byte[] getBytes(long pos, int len)
           
 long length()
           
 long position(Blob blob, long pos)
           
 long position(byte[] bytes, long pos)
           
 OutputStream setBinaryStream(long pos)
           
 int setBytes(long pos, byte[] bytes)
           
 int setBytes(long pos, byte[] bytes, int i, int j)
           
 void truncate(long pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlobImpl

public BlobImpl(byte[] bytes)

BlobImpl

public BlobImpl(InputStream stream,
                int length)
Method Detail

length

public long length()
            throws SQLException
Specified by:
length in interface Blob
Throws:
SQLException
See Also:
Blob.length()

truncate

public void truncate(long pos)
              throws SQLException
Specified by:
truncate in interface Blob
Throws:
SQLException
See Also:
Blob.truncate(long)

getBytes

public byte[] getBytes(long pos,
                       int len)
                throws SQLException
Specified by:
getBytes in interface Blob
Throws:
SQLException
See Also:
Blob.getBytes(long, int)

setBytes

public int setBytes(long pos,
                    byte[] bytes)
             throws SQLException
Specified by:
setBytes in interface Blob
Throws:
SQLException
See Also:
Blob.setBytes(long, byte[])

setBytes

public int setBytes(long pos,
                    byte[] bytes,
                    int i,
                    int j)
             throws SQLException
Specified by:
setBytes in interface Blob
Throws:
SQLException
See Also:
Blob.setBytes(long, byte[], int, int)

position

public long position(byte[] bytes,
                     long pos)
              throws SQLException
Specified by:
position in interface Blob
Throws:
SQLException
See Also:
Blob.position(byte[], long)

getBinaryStream

public InputStream getBinaryStream()
                            throws SQLException
Specified by:
getBinaryStream in interface Blob
Throws:
SQLException
See Also:
Blob.getBinaryStream()

setBinaryStream

public OutputStream setBinaryStream(long pos)
                             throws SQLException
Specified by:
setBinaryStream in interface Blob
Throws:
SQLException
See Also:
Blob.setBinaryStream(long)

position

public long position(Blob blob,
                     long pos)
              throws SQLException
Specified by:
position in interface Blob
Throws:
SQLException
See Also:
Blob.position(Blob, long)