Class RAMFile

  • All Implemented Interfaces:
    Accountable

    @Deprecated
    public class RAMFile
    extends Object
    implements Accountable
    Deprecated.
    This class uses inefficient synchronization and is discouraged in favor of MMapDirectory. It will be removed in future versions of Lucene.
    Represents a file in RAM as a list of byte[] buffers.
    NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
    • Field Detail

      • buffers

        protected final ArrayList<byte[]> buffers
        Deprecated.
      • sizeInBytes

        protected long sizeInBytes
        Deprecated.
    • Constructor Detail

      • RAMFile

        public RAMFile()
        Deprecated.
    • Method Detail

      • getLength

        public long getLength()
        Deprecated.
      • setLength

        protected void setLength​(long length)
        Deprecated.
      • addBuffer

        protected final byte[] addBuffer​(int size)
        Deprecated.
      • getBuffer

        protected final byte[] getBuffer​(int index)
        Deprecated.
      • numBuffers

        protected final int numBuffers()
        Deprecated.
      • newBuffer

        protected byte[] newBuffer​(int size)
        Deprecated.
        Expert: allocate a new buffer. Subclasses can allocate differently.
        Parameters:
        size - size of allocated buffer.
        Returns:
        allocated buffer.
      • ramBytesUsed

        public long ramBytesUsed()
        Deprecated.
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.
        Specified by:
        ramBytesUsed in interface Accountable
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Deprecated.
        Overrides:
        equals in class Object