org.apache.cassandra.io.util
Class Memory
java.lang.Object
org.apache.cassandra.io.util.Memory
- Direct Known Subclasses:
- FreeableMemory
public class Memory
- extends java.lang.Object
Field Summary |
protected long |
peer
|
Constructor Summary |
protected |
Memory(long bytes)
|
Method Summary |
static Memory |
allocate(long bytes)
|
void |
free()
|
byte |
getByte(long offset)
|
void |
getBytes(long memoryOffset,
byte[] buffer,
int bufferOffset,
int count)
Transfers count bytes from Memory starting at memoryOffset to buffer starting at bufferOffset |
void |
setByte(long offset,
byte b)
|
void |
setBytes(long memoryOffset,
byte[] buffer,
int bufferOffset,
int count)
Transfers count bytes from buffer to Memory |
long |
size()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
peer
protected long peer
Memory
protected Memory(long bytes)
allocate
public static Memory allocate(long bytes)
setByte
public void setByte(long offset,
byte b)
setBytes
public void setBytes(long memoryOffset,
byte[] buffer,
int bufferOffset,
int count)
- Transfers count bytes from buffer to Memory
- Parameters:
memoryOffset
- start offset in the memorybuffer
- the data bufferbufferOffset
- start offset of the buffercount
- number of bytes to transfer
getByte
public byte getByte(long offset)
getBytes
public void getBytes(long memoryOffset,
byte[] buffer,
int bufferOffset,
int count)
- Transfers count bytes from Memory starting at memoryOffset to buffer starting at bufferOffset
- Parameters:
memoryOffset
- start offset in the memorybuffer
- the data bufferbufferOffset
- start offset of the buffercount
- number of bytes to transfer
free
public void free()
size
public long size()
Copyright © 2012 The Apache Software Foundation