com.caucho.db.blob
Class ClobReader

java.lang.Object
  extended by java.io.Reader
      extended by com.caucho.db.blob.ClobReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class ClobReader
extends java.io.Reader


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
ClobReader(BlockStore store, byte[] inode, int inodeOffset)
          Creates a clob reader.
ClobReader(Inode inode)
          Creates a clob reader.
 
Method Summary
 void close()
          Closes the buffer.
 void init(BlockStore store, byte[] inode, int inodeOffset)
          Initialize the output stream.
 int read()
          Reads a char.
 int read(char[] buf, int offset, int length)
          Reads a buffer.
static long readLong(byte[] buffer, int offset)
          Writes the long.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClobReader

public ClobReader(BlockStore store,
                  byte[] inode,
                  int inodeOffset)
Creates a clob reader.

Parameters:
store - the backing store

ClobReader

public ClobReader(Inode inode)
Creates a clob reader.

Parameters:
store - the backing 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 char.

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

read

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

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

close

public void close()
Closes the buffer.

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader

readLong

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