org.objectweb.jorm.mapper.rdb.lib

Class RdbBlob

Implemented Interfaces:
Blob

public class RdbBlob
extends OutputStream
implements Blob

Author:
P. Dechamboux

Nested Class Summary

(package private) class
RdbBlob.RdbInputStream

Field Summary

static int
DEFAULT_BUFFER_SIZE
protected ArrayList
bufferList
This arrayList contains buffers.
protected int
bufferSize
The size of the buffer stored in the buffer list
private byte[]
currentBuffer
The current buffer.
private int
currentPos
The current position in the last buffer
protected int
size
The total length

Constructor Summary

RdbBlob(Serializable serobj)
This constructor calculates the size of the serialized object.
RdbBlob(Serializable serobj, int buffersize)
This constructor calculates the size of the serialized object.

Method Summary

private void
bprintln(String msg1, byte b, String msg2)
void
close()
do nothing
void
flush()
do nothing
InputStream
getBinaryStream()
byte[]
getBytes(long pos, int length)
long
length()
long
position(Blob blob, long l)
long
position(byte[] bytes, long l)
private void
println(String msg)
OutputStream
setBinaryStream(long pos)
int
setBytes(long pos, byte[] bytes)
int
setBytes(long pos, byte[] bytes, int offset, int len)
void
truncate(long len)
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)

Field Details

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE

Field Value:
1024


bufferList

protected ArrayList bufferList
This arrayList contains buffers. A buffer is a byte[] which the size is bufferSize.


bufferSize

protected int bufferSize
The size of the buffer stored in the buffer list


currentBuffer

private byte[] currentBuffer
The current buffer.


currentPos

private int currentPos
The current position in the last buffer


size

protected int size
The total length

Constructor Details

RdbBlob

public RdbBlob(Serializable serobj)
            throws IOException
This constructor calculates the size of the serialized object.


RdbBlob

public RdbBlob(Serializable serobj,
               int buffersize)
            throws IOException
This constructor calculates the size of the serialized object.

Method Details

bprintln

private void bprintln(String msg1,
                      byte b,
                      String msg2)


close

public void close()
do nothing


flush

public void flush()
do nothing


getBinaryStream

public InputStream getBinaryStream()
            throws SQLException


getBytes

public byte[] getBytes(long pos,
                       int length)
            throws SQLException


length

public long length()
            throws SQLException


position

public long position(Blob blob,
                     long l)
            throws SQLException


position

public long position(byte[] bytes,
                     long l)
            throws SQLException


println

private void println(String msg)


setBinaryStream

public OutputStream setBinaryStream(long pos)
            throws SQLException


setBytes

public int setBytes(long pos,
                    byte[] bytes)
            throws SQLException


setBytes

public int setBytes(long pos,
                    byte[] bytes,
                    int offset,
                    int len)
            throws SQLException


truncate

public void truncate(long len)
            throws SQLException


write

public void write(byte[] b)
            throws IOException


write

public void write(byte[] b,
                  int off,
                  int len)
            throws IOException


write

public void write(int b)
            throws IOException