org.apache.lucene.store

Class RAMOutputStream


public class RAMOutputStream
extends BufferedIndexOutput

A memory-resident IndexOutput implementation.
Version:
$Id: RAMOutputStream.java 381429 2006-02-27 20:17:01Z cutting $

Constructor Summary

RAMOutputStream()
Construct an empty output buffer.

Method Summary

void
close()
Closes this stream to further operations.
void
flushBuffer(byte[] src, int len)
Expert: implements buffer write.
long
length()
The number of bytes in the file.
void
reset()
Resets this to an empty buffer.
void
seek(long pos)
Sets current position in this file, where the next write will occur.
void
writeTo(IndexOutput out)
Copy the current contents of this buffer to the named output.

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

close, flush, flushBuffer, getFilePointer, length, seek, writeByte, writeBytes

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

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

Constructor Details

RAMOutputStream

public RAMOutputStream()
Construct an empty output buffer.

Method Details

close

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

flushBuffer

public void flushBuffer(byte[] src,
                        int len)
Expert: implements buffer write. Writes bytes at the current position in the output.
Overrides:
flushBuffer in interface BufferedIndexOutput
Parameters:
len - the number of bytes to write

length

public long length()
The number of bytes in the file.
Overrides:
length in interface BufferedIndexOutput

reset

public void reset()
Resets this to an empty buffer.

seek

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

writeTo

public void writeTo(IndexOutput out)
            throws IOException
Copy the current contents of this buffer to the named output.

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