org.hibernate.lob
Class BlobImpl

java.lang.Object
  extended by org.hibernate.lob.BlobImpl
All Implemented Interfaces:
java.sql.Blob

public class BlobImpl
extends java.lang.Object
implements java.sql.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(java.io.InputStream stream, int length)
           
 
Method Summary
 java.io.InputStream getBinaryStream()
           
 byte[] getBytes(long pos, int len)
           
 long length()
           
 long position(java.sql.Blob blob, long pos)
           
 long position(byte[] bytes, long pos)
           
 java.io.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(java.io.InputStream stream,
                int length)
Method Detail

length

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

truncate

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

getBytes

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

setBytes

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

setBytes

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

position

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

getBinaryStream

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

setBinaryStream

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

position

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


Copyright © 2008 Hibernate.org. All Rights Reserved.