org.apache.lucene.store

Class BufferedIndexOutput

public abstract class BufferedIndexOutput extends IndexOutput

Base implementation class for buffered {@link IndexOutput}.
Method Summary
voidclose()
Closes this stream to further operations.
voidflush()
Forces any buffered output to be written.
protected abstract voidflushBuffer(byte[] b, int len)
Expert: implements buffer write.
longgetFilePointer()
Returns the current position in this file, where the next write will occur.
abstract longlength()
The number of bytes in the file.
voidseek(long pos)
Sets current position in this file, where the next write will occur.
voidwriteByte(byte b)
Writes a single byte.
voidwriteBytes(byte[] b, int length)
Writes an array of bytes.

Method Detail

close

public void close()
Closes this stream to further operations.

flush

public void flush()
Forces any buffered output to be written.

flushBuffer

protected abstract void flushBuffer(byte[] b, int len)
Expert: implements buffer write. Writes bytes at the current position in the output.

Parameters: b the bytes to write len the number of bytes to write

getFilePointer

public long getFilePointer()
Returns the current position in this file, where the next write will occur.

See Also: BufferedIndexOutput

length

public abstract long length()
The number of bytes in the file.

seek

public void seek(long pos)
Sets current position in this file, where the next write will occur.

See Also: getFilePointer

writeByte

public void writeByte(byte b)
Writes a single byte.

See Also: readByte

writeBytes

public void writeBytes(byte[] b, int length)
Writes an array of bytes.

Parameters: b the bytes to write length the number of bytes to write

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

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