Package org.apache.lucene.store
Class RAMFile
- java.lang.Object
-
- org.apache.lucene.store.RAMFile
-
public class RAMFile extends Object
Represents a file in RAM as a list of byte[] buffers.
-
-
Field Summary
Fields Modifier and Type Field Description protected ArrayList<byte[]>buffersprotected longsizeInBytes
-
Constructor Summary
Constructors Constructor Description RAMFile()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]addBuffer(int size)protected byte[]getBuffer(int index)longgetLength()longgetSizeInBytes()protected byte[]newBuffer(int size)Expert: allocate a new buffer.protected intnumBuffers()protected voidsetLength(long length)
-
-
-
Field Detail
-
buffers
protected ArrayList<byte[]> buffers
-
sizeInBytes
protected long sizeInBytes
-
-
Method Detail
-
getLength
public long getLength()
-
setLength
protected void setLength(long length)
-
addBuffer
protected final byte[] addBuffer(int size)
-
getBuffer
protected final byte[] getBuffer(int index)
-
numBuffers
protected final int numBuffers()
-
newBuffer
protected byte[] newBuffer(int size)
Expert: allocate a new buffer. Subclasses can allocate differently.- Parameters:
size- size of allocated buffer.- Returns:
- allocated buffer.
-
getSizeInBytes
public long getSizeInBytes()
-
-