com.timeindexing.plugin
Class Block

java.lang.Object
  extended bycom.timeindexing.plugin.DefaultReader
      extended bycom.timeindexing.plugin.Block
All Implemented Interfaces:
ReaderPlugin

public class Block
extends DefaultReader
implements ReaderPlugin

A plugin that takes an input stream and returns a block at a time.


Constructor Summary
Block(java.io.BufferedReader inReader)
          Construct a Block plugin from a BufferedReader.
Block(java.io.InputStream inStream)
          Construct a Block plugin from an InputStream.
Block(java.io.Reader inReader)
          Construct a Block plugin from a Reader.
 
Method Summary
 int getBlockSize()
          Get the block size.
protected  ReaderResult process(java.nio.ByteBuffer block)
          Process the block
 ReaderResult read()
          Get next input buffer.
 int setBlockSize(int noOfK)
          Set the block size, in incrments of 1K.
 
Methods inherited from class com.timeindexing.plugin.DefaultReader
getInputStream, isEOF, setEOF, setInputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.timeindexing.plugin.ReaderPlugin
getInputStream, isEOF, setEOF, setInputStream
 

Constructor Detail

Block

public Block(java.io.InputStream inStream)
Construct a Block plugin from an InputStream.


Block

public Block(java.io.Reader inReader)
Construct a Block plugin from a Reader.


Block

public Block(java.io.BufferedReader inReader)
Construct a Block plugin from a BufferedReader.

Method Detail

read

public ReaderResult read()
                  throws java.io.IOException
Get next input buffer.

Specified by:
read in interface ReaderPlugin
Throws:
java.io.IOException

process

protected ReaderResult process(java.nio.ByteBuffer block)
Process the block


getBlockSize

public int getBlockSize()
Get the block size.


setBlockSize

public int setBlockSize(int noOfK)
Set the block size, in incrments of 1K. Returns the actual value set.