gate.creole.annic.apache.lucene.store
Class RAMInputStream

java.lang.Object
  extended by gate.creole.annic.apache.lucene.store.InputStream
      extended by gate.creole.annic.apache.lucene.store.RAMInputStream
All Implemented Interfaces:
Cloneable

 class RAMInputStream
extends InputStream
implements Cloneable

A memory-resident InputStream implementation.

Version:
$Id: RAMInputStream.java 529 2004-10-05 11:55:26Z niraj $

Field Summary
private  RAMFile file
           
private  int pointer
           
 
Fields inherited from class gate.creole.annic.apache.lucene.store.InputStream
BUFFER_SIZE, length
 
Constructor Summary
RAMInputStream(RAMFile f)
           
 
Method Summary
 void close()
          Closes the stream to futher operations.
 void readInternal(byte[] dest, int destOffset, int len)
          Expert: implements buffer refill.
 void seekInternal(long pos)
          Expert: implements seek.
 
Methods inherited from class gate.creole.annic.apache.lucene.store.InputStream
clone, getFilePointer, length, readByte, readBytes, readChars, readInt, readLong, readString, readVInt, readVLong, seek
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private RAMFile file

pointer

private int pointer
Constructor Detail

RAMInputStream

public RAMInputStream(RAMFile f)
Method Detail

readInternal

public void readInternal(byte[] dest,
                         int destOffset,
                         int len)
Description copied from class: InputStream
Expert: implements buffer refill. Reads bytes from the current position in the input.

Specified by:
readInternal in class InputStream
Parameters:
dest - the array to read bytes into
destOffset - the offset in the array to start storing bytes
len - the number of bytes to read

close

public void close()
Description copied from class: InputStream
Closes the stream to futher operations.

Specified by:
close in class InputStream

seekInternal

public void seekInternal(long pos)
Description copied from class: InputStream
Expert: implements seek. Sets current position in this file, where the next InputStream.readInternal(byte[],int,int) will occur.

Specified by:
seekInternal in class InputStream
See Also:
InputStream.readInternal(byte[],int,int)