org.apache.lucene.store

Class BufferedIndexInput

public abstract class BufferedIndexInput extends IndexInput

Base implementation class for buffered IndexInput.
Field Summary
static intBUFFER_SIZE
Default buffer size
Constructor Summary
BufferedIndexInput()
BufferedIndexInput(int bufferSize)
Inits BufferedIndexInput with a specific bufferSize
Method Summary
Objectclone()
intgetBufferSize()
Returns buffer size.
longgetFilePointer()
bytereadByte()
voidreadBytes(byte[] b, int offset, int len)
protected abstract voidreadInternal(byte[] b, int offset, int length)
Expert: implements buffer refill.
voidseek(long pos)
protected abstract voidseekInternal(long pos)
Expert: implements seek.
voidsetBufferSize(int newSize)
Change the buffer size used by this IndexInput

Field Detail

BUFFER_SIZE

public static final int BUFFER_SIZE
Default buffer size

Constructor Detail

BufferedIndexInput

public BufferedIndexInput()

BufferedIndexInput

public BufferedIndexInput(int bufferSize)
Inits BufferedIndexInput with a specific bufferSize

Method Detail

clone

public Object clone()

getBufferSize

public int getBufferSize()
Returns buffer size. @see #setBufferSize

getFilePointer

public long getFilePointer()

readByte

public byte readByte()

readBytes

public void readBytes(byte[] b, int offset, int len)

readInternal

protected abstract void readInternal(byte[] b, int offset, int length)
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)

seekInternal

protected abstract void seekInternal(long pos)
Expert: implements seek. Sets current position in this file, where the next (byte[],int,int) will occur.

See Also: (byte[],int,int)

setBufferSize

public void setBufferSize(int newSize)
Change the buffer size used by this IndexInput
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.