Class RAMOutputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Accountable

    @Deprecated
    public class RAMOutputStream
    extends IndexOutput
    implements Accountable
    Deprecated.
    This class uses inefficient synchronization and is discouraged in favor of MMapDirectory. It will be removed in future versions of Lucene.
    A memory-resident IndexOutput implementation.
    NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
    • Constructor Detail

      • RAMOutputStream

        public RAMOutputStream()
        Deprecated.
        Construct an empty output buffer.
      • RAMOutputStream

        public RAMOutputStream​(RAMFile f,
                               boolean checksum)
        Deprecated.
        Creates this, with no name.
      • RAMOutputStream

        public RAMOutputStream​(String name,
                               RAMFile f,
                               boolean checksum)
        Deprecated.
        Creates this, with specified name.
    • Method Detail

      • writeTo

        public void writeTo​(byte[] bytes,
                            int offset)
                     throws IOException
        Deprecated.
        Copy the current contents of this buffer to output byte array
        Throws:
        IOException
      • reset

        public void reset()
        Deprecated.
        Resets this to an empty file.
      • writeByte

        public void writeByte​(byte b)
                       throws IOException
        Deprecated.
        Description copied from class: DataOutput
        Writes a single byte.

        The most primitive data type is an eight-bit byte. Files are accessed as sequences of bytes. All other data types are defined as sequences of bytes, so file formats are byte-order independent.

        Specified by:
        writeByte in class DataOutput
        Throws:
        IOException
        See Also:
        DataInput.readByte()
      • flush

        protected void flush()
                      throws IOException
        Deprecated.
        Forces any buffered output to be written.
        Throws:
        IOException
      • getFilePointer

        public long getFilePointer()
        Deprecated.
        Description copied from class: IndexOutput
        Returns the current position in this file, where the next write will occur.
        Specified by:
        getFilePointer in class IndexOutput
      • ramBytesUsed

        public long ramBytesUsed()
        Deprecated.
        Returns byte usage of all buffers.
        Specified by:
        ramBytesUsed in interface Accountable