public class RAMFile extends java.lang.Object implements Accountable
| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList<byte[]> |
buffers |
(package private) RAMDirectory |
directory |
(package private) long |
length |
protected long |
sizeInBytes |
| Constructor and Description |
|---|
RAMFile() |
RAMFile(RAMDirectory directory) |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
addBuffer(int size) |
boolean |
equals(java.lang.Object obj) |
protected byte[] |
getBuffer(int index) |
long |
getLength() |
int |
hashCode() |
protected byte[] |
newBuffer(int size)
Expert: allocate a new buffer.
|
protected int |
numBuffers() |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
protected void |
setLength(long length) |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChildResourcesprotected final java.util.ArrayList<byte[]> buffers
long length
RAMDirectory directory
protected long sizeInBytes
public RAMFile()
RAMFile(RAMDirectory directory)
public long getLength()
protected void setLength(long length)
protected final byte[] addBuffer(int size)
protected final byte[] getBuffer(int index)
protected final int numBuffers()
protected byte[] newBuffer(int size)
size - size of allocated buffer.public long ramBytesUsed()
AccountableramBytesUsed in interface Accountablepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object