org.apache.lucene.store

Class BufferedIndexInput

Implemented Interfaces:
Cloneable
Known Direct Subclasses:
InputStream

public abstract class BufferedIndexInput
extends IndexInput

Base implementation class for buffered IndexInput.

Method Summary

Object
clone()
Returns a clone of this stream.
long
getFilePointer()
Returns the current position in this file, where the next read will occur.
byte
readByte()
Reads and returns a single byte.
void
readBytes(byte[] b, int offset, int len)
Reads a specified number of bytes into an array at the specified offset.
protected abstract void
readInternal(byte[] b, int offset, int length)
Expert: implements buffer refill.
void
seek(long pos)
Sets current position in this file, where the next read will occur.
protected abstract void
seekInternal(long pos)
Expert: implements seek.

Methods inherited from class org.apache.lucene.store.IndexInput

clone, close, getFilePointer, length, readByte, readBytes, readChars, readInt, readLong, readString, readVInt, readVLong, seek

Method Details

clone

public Object clone()
Returns a clone of this stream.

Clones of a stream access the same data, and are positioned at the same point as the stream they were cloned from.

Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from.

Overrides:
clone in interface IndexInput

getFilePointer

public long getFilePointer()
Returns the current position in this file, where the next read will occur.
Overrides:
getFilePointer in interface IndexInput

readByte

public byte readByte()
            throws IOException
Reads and returns a single byte.
Overrides:
readByte in interface IndexInput

readBytes

public void readBytes(byte[] b,
                      int offset,
                      int len)
            throws IOException
Reads a specified number of bytes into an array at the specified offset.
Overrides:
readBytes in interface IndexInput
Parameters:
b - the array to read bytes into
offset - the offset in the array to start storing bytes
len - the number of bytes to read

readInternal

protected abstract void readInternal(byte[] b,
                                     int offset,
                                     int length)
            throws IOException
Expert: implements buffer refill. Reads bytes from the current position in the input.
Parameters:
b - the array to read bytes into
offset - the offset in the array to start storing bytes
length - the number of bytes to read

seek

public void seek(long pos)
            throws IOException
Sets current position in this file, where the next read will occur.
Overrides:
seek in interface IndexInput

seekInternal

protected abstract void seekInternal(long pos)
            throws IOException

Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.