com.caucho.db.blob
Class BlobInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.caucho.db.blob.BlobInputStream
All Implemented Interfaces:
java.io.Closeable

public class BlobInputStream
extends java.io.InputStream


Constructor Summary
BlobInputStream(BlockStore store, byte[] inode, int inodeOffset)
          Creates a blob output stream.
BlobInputStream(Inode inode)
          Creates a blob output stream.
 
Method Summary
 void close()
          Closes the buffer.
 void init(BlockStore store, byte[] inode, int inodeOffset)
          Initialize the output stream.
 int read()
          Reads a byte.
 int read(byte[] buf, int offset, int length)
          Reads a buffer.
static long readLong(byte[] buffer, int offset)
          Writes the long.
 int readToOutput(java.io.OutputStream os)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlobInputStream

public BlobInputStream(BlockStore store,
                       byte[] inode,
                       int inodeOffset)
Creates a blob output stream.

Parameters:
store - the output store

BlobInputStream

public BlobInputStream(Inode inode)
Creates a blob output stream.

Parameters:
store - the output store
Method Detail

init

public void init(BlockStore store,
                 byte[] inode,
                 int inodeOffset)
Initialize the output stream.


read

public int read()
         throws java.io.IOException
Reads a byte.

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

read

public int read(byte[] buf,
                int offset,
                int length)
         throws java.io.IOException
Reads a buffer.

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

readToOutput

public int readToOutput(java.io.OutputStream os)
                 throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
Closes the buffer.

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

readLong

public static long readLong(byte[] buffer,
                            int offset)
Writes the long.