public class

RAMOutputStream

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

Class Overview

A memory-resident IndexOutput implementation.

For Lucene internal use.

Summary

Public Constructors
RAMOutputStream()
Construct an empty output buffer.
RAMOutputStream(RAMFile f)
Public Methods
void close()
Closes this stream to further operations.
void flush()
Forces any buffered output to be written.
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 reset()
Resets this to an empty file.
void seek(long pos)
Sets current position in this file, where the next write will occur.
long sizeInBytes()
Returns byte usage of all buffers.
void writeByte(byte b)
Writes a single byte.
void writeBytes(byte[] b, int offset, int len)
Writes an array of bytes.
void writeTo(IndexOutput out)
Copy the current contents of this buffer to the named output.
[Expand]
Inherited Methods
From class org.apache.lucene.store.IndexOutput
From class java.lang.Object
From interface java.io.Closeable

Public Constructors

public RAMOutputStream ()

Construct an empty output buffer.

public RAMOutputStream (RAMFile f)

Public Methods

public void close ()

Closes this stream to further operations.

Throws
IOException

public void flush ()

Forces any buffered output to be written.

Throws
IOException

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.

public void reset ()

Resets this to an empty file.

public void seek (long pos)

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

Throws
IOException

public long sizeInBytes ()

Returns byte usage of all buffers.

public void writeByte (byte b)

Writes a single byte.

Throws
IOException

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

Writes an array of bytes.

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

public void writeTo (IndexOutput out)

Copy the current contents of this buffer to the named output.

Throws
IOException