SQLite
Class BlobR

java.lang.Object
  extended by java.io.InputStream
      extended by SQLite.BlobR
All Implemented Interfaces:
java.io.Closeable

 class BlobR
extends java.io.InputStream

Internal class implementing java.io.InputStream on SQLite 3.4.0 incremental blob I/O interface.


Field Summary
private  Blob blob
          Blob instance
private  int pos
          Read position, file pointer.
 
Constructor Summary
BlobR(Blob blob)
          Contruct InputStream from blob instance.
 
Method Summary
 int available()
          Return number of available bytes for reading.
 void close()
          Close this blob InputStream.
 void mark(int limit)
          Mark method; dummy to satisfy InputStream class.
 boolean markSupported()
          Mark support; not for this class.
 int read()
          Read single byte from blob.
 int read(byte[] b)
          Read byte array from blob.
 int read(byte[] b, int off, int len)
          Read slice of byte array from blob.
 void reset()
          Reset method; dummy to satisfy InputStream class.
 long skip(long n)
          Skip over blob data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blob

private Blob blob
Blob instance


pos

private int pos
Read position, file pointer.

Constructor Detail

BlobR

BlobR(Blob blob)
Contruct InputStream from blob instance.

Method Detail

available

public int available()
              throws java.io.IOException
Return number of available bytes for reading.

Overrides:
available in class java.io.InputStream
Returns:
available input bytes
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close this blob InputStream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

mark

public void mark(int limit)
Mark method; dummy to satisfy InputStream class.

Overrides:
mark in class java.io.InputStream

markSupported

public boolean markSupported()
Mark support; not for this class.

Overrides:
markSupported in class java.io.InputStream
Returns:
always false

read

public int read()
         throws java.io.IOException
Read single byte from blob.

Specified by:
read in class java.io.InputStream
Returns:
byte read
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Read byte array from blob.

Overrides:
read in class java.io.InputStream
Parameters:
b - byte array to be filled
Returns:
number of bytes read
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Read slice of byte array from blob.

Overrides:
read in class java.io.InputStream
Parameters:
b - byte array to be filled
off - offset into byte array
len - length to be read
Returns:
number of bytes read
Throws:
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Reset method; dummy to satisfy InputStream class.

Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException

skip

public long skip(long n)
          throws java.io.IOException
Skip over blob data.

Overrides:
skip in class java.io.InputStream
Throws:
java.io.IOException


Contact: Christian Werner