public class

ChecksumIndexOutput

extends IndexOutput
java.lang.Object
   ↳ org.apache.lucene.store.IndexOutput
     ↳ org.apache.lucene.store.ChecksumIndexOutput

Class Overview

Writes bytes through to a primary IndexOutput, computing checksum. Note that you cannot use seek().

Summary

Public Constructors
ChecksumIndexOutput(IndexOutput main)
Public Methods
void close()
Closes this stream to further operations.
void finishCommit()
void flush()
Forces any buffered output to be written.
long getChecksum()
long getFilePointer()
Returns the current position in this file, where the next write will occur.
long length()
The number of bytes in the file.
void prepareCommit()
Starts but does not complete the commit of this file (= writing of the final checksum at the end).
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 offset, int length)
Writes an array of bytes.
[Expand]
Inherited Methods
From class org.apache.lucene.store.IndexOutput
From class java.lang.Object
From interface java.io.Closeable

Public Constructors

public ChecksumIndexOutput (IndexOutput main)

Public Methods

public void close ()

Closes this stream to further operations.

Throws
IOException

public void finishCommit ()

public void flush ()

Forces any buffered output to be written.

Throws
IOException

public long getChecksum ()

public long getFilePointer ()

Returns the current position in this file, where the next write will occur.

public long length ()

The number of bytes in the file.

Throws
IOException

public void prepareCommit ()

Starts but does not complete the commit of this file (= writing of the final checksum at the end). After this is called must call finishCommit() and the close() to complete the commit.

Throws
IOException

public void seek (long pos)

Sets current position in this file, where the next write will occur.

public void writeByte (byte b)

Writes a single byte.

Throws
IOException

public void writeBytes (byte[] b, int offset, int length)

Writes an array of bytes.

Parameters
b the bytes to write
offset the offset in the byte array
length the number of bytes to write
Throws
IOException