SQLite

Class Blob

public class Blob extends Object

Class to represent SQLite3 3.4.0 incremental blob I/O interface. Note, that all native methods of this class are not synchronized, i.e. it is up to the caller to ensure that only one thread is in these methods at any one time.
Field Summary
longhandle
Internal handle for the SQLite3 blob.
protected intsize
Cached size of blob, setup right after blob has been opened.
Method Summary
voidclose()
Close blob.
protected voidfinalize()
Destructor for object.
InputStreamgetInputStream()
Return InputStream for this blob
OutputStreamgetOutputStream()
Return OutputStream for this blob
static voidinternal_init()
Internal native initializer.
intread(byte[] b, int off, int pos, int len)
Internal blob read method.
intwrite(byte[] b, int off, int pos, int len)
Internal blob write method.

Field Detail

handle

private long handle
Internal handle for the SQLite3 blob.

size

protected int size
Cached size of blob, setup right after blob has been opened.

Method Detail

close

public void close()
Close blob.

finalize

protected void finalize()
Destructor for object.

getInputStream

public InputStream getInputStream()
Return InputStream for this blob

Returns: InputStream

getOutputStream

public OutputStream getOutputStream()
Return OutputStream for this blob

Returns: OutputStream

internal_init

private static void internal_init()
Internal native initializer.

read

int read(byte[] b, int off, int pos, int len)
Internal blob read method.

Parameters: b byte array to be written off offset into byte array pos offset into blob len length to be written

Returns: number of bytes written to blob

write

int write(byte[] b, int off, int pos, int len)
Internal blob write method.

Parameters: b byte array to be written off offset into byte array pos offset into blob len length to be written

Returns: number of bytes written to blob

Contact: Christian Werner