com.caucho.db.blob
Class InodeBlobInputStream

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

public class InodeBlobInputStream
extends java.io.InputStream

Directly reading the blob from the inode.


Constructor Summary
InodeBlobInputStream(BlockStore store, byte[] inode, int inodeOffset)
          Creates a blob output stream.
InodeBlobInputStream(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.
 void readBlock()
          Updates the buffer.
static long readLong(byte[] buffer, int offset)
          Writes the long.
 
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

InodeBlobInputStream

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

Parameters:
store - the output store

InodeBlobInputStream

public InodeBlobInputStream(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

close

public void close()
Closes the buffer.

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

readBlock

public void readBlock()
               throws java.io.IOException
Updates the buffer.

Throws:
java.io.IOException

readLong

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