org.hibernate.lob

Class BlobImpl

Implemented Interfaces:
Blob

public class BlobImpl
extends java.lang.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(InputStream stream, int length)
BlobImpl(byte[] bytes)

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)

Constructor Details

BlobImpl

public BlobImpl(InputStream stream,
                int length)

BlobImpl

public BlobImpl(byte[] bytes)

Method Details

getBinaryStream

public InputStream getBinaryStream()
            throws SQLException
See Also:
java.sql.Blob.getBinaryStream()

getBytes

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

length

public long length()
            throws SQLException
See Also:
java.sql.Blob.length()

position

public long position(Blob blob,
                     long pos)
            throws SQLException
See Also:
java.sql.Blob.position(Blob, long)

position

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

setBinaryStream

public OutputStream setBinaryStream(long pos)
            throws SQLException
See Also:
java.sql.Blob.setBinaryStream(long)

setBytes

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

setBytes

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

truncate

public void truncate(long pos)
            throws SQLException
See Also:
java.sql.Blob.truncate(long)