org.apache.lucene.store

Class BufferedIndexOutput

Known Direct Subclasses:
OutputStream, RAMOutputStream

public abstract class BufferedIndexOutput
extends IndexOutput

Base implementation class for buffered IndexOutput.

Method Summary

void
close()
Closes this stream to further operations.
void
flush()
Forces any buffered output to be written.
protected abstract void
flushBuffer(byte[] b, int len)
Expert: implements buffer write.
long
getFilePointer()
Returns the current position in this file, where the next write will occur.
abstract long
length()
The number of bytes in the file.
void
seek(long pos)
Sets current position in this file, where the next write will occur.
void
writeByte(byte b)
Writes a single byte.
void
writeBytes(byte[] b, int length)
Writes an array of bytes.

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

close, flush, getFilePointer, length, seek, writeByte, writeBytes, writeChars, writeInt, writeLong, writeString, writeVInt, writeVLong

Method Details

close

public void close()
            throws IOException
Closes this stream to further operations.
Overrides:
close in interface IndexOutput

flush

public void flush()
            throws IOException
Forces any buffered output to be written.
Overrides:
flush in interface IndexOutput

flushBuffer

protected abstract void flushBuffer(byte[] b,
                                    int len)
            throws IOException
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.
Overrides:
getFilePointer in interface IndexOutput
See Also:
seek(long)

length

public abstract long length()
            throws IOException
The number of bytes in the file.
Overrides:
length in interface IndexOutput

seek

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

writeByte

public void writeByte(byte b)
            throws IOException
Writes a single byte.
Overrides:
writeByte in interface IndexOutput

writeBytes

public void writeBytes(byte[] b,
                       int length)
            throws IOException
Writes an array of bytes.
Overrides:
writeBytes in interface IndexOutput
Parameters:
b - the bytes to write
length - the number of bytes to write

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