SQLite
Class Blob

java.lang.Object
  extended bySQLite.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
private  long handle
          Internal handle for the SQLite3 blob.
protected  int size
          Cached size of blob, setup right after blob has been opened.
 
Constructor Summary
Blob()
           
 
Method Summary
 void close()
          Close blob.
protected  void finalize()
          Destructor for object.
 InputStream getInputStream()
          Return InputStream for this blob
 OutputStream getOutputStream()
          Return OutputStream for this blob
private static void internal_init()
          Internal native initializer.
(package private)  int read(byte[] b, int off, int pos, int len)
          Internal blob read method.
(package private)  int write(byte[] b, int off, int pos, int len)
          Internal blob write method.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

Constructor Detail

Blob

public Blob()
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)
   throws IOException
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
Throws:
IOException - on I/O error

write

int write(byte[] b,
          int off,
          int pos,
          int len)
    throws IOException
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
Throws:
IOException - on I/O error


Contact: Christian Werner