org.jboss.portal.jems.hibernate
Class ByteArrayBlob

java.lang.Object
  extended by org.jboss.portal.jems.hibernate.ByteArrayBlob
All Implemented Interfaces:
java.sql.Blob

public final class ByteArrayBlob
extends java.lang.Object
implements java.sql.Blob

Version:
$Revision: 8784 $
Author:
Julien Viet

Constructor Summary
ByteArrayBlob(java.sql.Blob blob)
           
ByteArrayBlob(byte[] _bytes)
           
ByteArrayBlob(ByteArrayBlob that)
           
ByteArrayBlob(java.io.InputStream in)
           
 
Method Summary
static ByteArrayBlob create(java.sql.Blob blob)
           
 void free()
           
static ByteArrayBlob get(java.sql.Blob blob)
           
 java.io.InputStream getBinaryStream()
           
 java.io.InputStream getBinaryStream(long pos, long length)
           
 byte[] getBytes(long pos, int length)
           
 long length()
           
 long position(java.sql.Blob pattern, long start)
           
 long position(byte[] pattern, long start)
           
 java.io.OutputStream setBinaryStream(long pos)
           
 int setBytes(long pos, byte[] bytes)
           
 int setBytes(long pos, byte[] bytes, int offset, int len)
           
 void truncate(long len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayBlob

public ByteArrayBlob(java.io.InputStream in)
              throws java.io.IOException
Throws:
java.io.IOException

ByteArrayBlob

public ByteArrayBlob(ByteArrayBlob that)

ByteArrayBlob

public ByteArrayBlob(byte[] _bytes)

ByteArrayBlob

public ByteArrayBlob(java.sql.Blob blob)
              throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

length

public long length()
Specified by:
length in interface java.sql.Blob

getBytes

public byte[] getBytes(long pos,
                       int length)
Specified by:
getBytes in interface java.sql.Blob

getBinaryStream

public java.io.InputStream getBinaryStream()
Specified by:
getBinaryStream in interface java.sql.Blob

getBinaryStream

public java.io.InputStream getBinaryStream(long pos,
                                           long length)

free

public void free()

setBytes

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

setBytes

public int setBytes(long pos,
                    byte[] bytes,
                    int offset,
                    int len)
Specified by:
setBytes in interface java.sql.Blob

setBinaryStream

public java.io.OutputStream setBinaryStream(long pos)
Specified by:
setBinaryStream in interface java.sql.Blob

position

public long position(byte[] pattern,
                     long start)
Specified by:
position in interface java.sql.Blob

position

public long position(java.sql.Blob pattern,
                     long start)
Specified by:
position in interface java.sql.Blob

truncate

public void truncate(long len)
Specified by:
truncate in interface java.sql.Blob

get

public static ByteArrayBlob get(java.sql.Blob blob)
                         throws java.io.IOException,
                                java.sql.SQLException
Throws:
java.io.IOException
java.sql.SQLException

create

public static ByteArrayBlob create(java.sql.Blob blob)
                            throws java.io.IOException,
                                   java.sql.SQLException
Throws:
java.io.IOException
java.sql.SQLException