org.apache.lucene.store
Class RAMOutputStream

java.lang.Object
  extended byorg.apache.lucene.store.IndexOutput
      extended byorg.apache.lucene.store.BufferedIndexOutput
          extended byorg.apache.lucene.store.RAMOutputStream

public class RAMOutputStream
extends BufferedIndexOutput

A memory-resident IndexOutput implementation.

Version:
$Id: RAMOutputStream.java 488330 2006-12-18 16:45:29Z mikemccand $

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
flush, getFilePointer, writeByte, writeBytes
 
Methods inherited from class org.apache.lucene.store.IndexOutput
writeChars, writeInt, writeLong, writeString, writeVInt, writeVLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RAMOutputStream

public RAMOutputStream()
Construct an empty output buffer.

Method Detail

writeTo

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

Throws:
IOException

reset

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


flushBuffer

public void flushBuffer(byte[] src,
                        int len)
                 throws IOException
Description copied from class: BufferedIndexOutput
Expert: implements buffer write. Writes bytes at the current position in the output.

Specified by:
flushBuffer in class BufferedIndexOutput
Parameters:
src - the bytes to write
len - the number of bytes to write
Throws:
IOException

close

public void close()
           throws IOException
Description copied from class: BufferedIndexOutput
Closes this stream to further operations.

Overrides:
close in class BufferedIndexOutput
Throws:
IOException

seek

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

Overrides:
seek in class BufferedIndexOutput
Throws:
IOException
See Also:
BufferedIndexOutput.getFilePointer()

length

public long length()
Description copied from class: BufferedIndexOutput
The number of bytes in the file.

Specified by:
length in class BufferedIndexOutput


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