public class Memory
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected long |
peer |
protected long |
size |
Modifier | Constructor and Description |
---|---|
protected |
Memory(long bytes) |
protected |
Memory(Memory copyOf) |
Modifier and Type | Method and Description |
---|---|
static Memory |
allocate(long bytes) |
java.nio.ByteBuffer[] |
asByteBuffers(long offset,
long length) |
protected void |
checkBounds(long start,
long end) |
void |
close() |
Memory |
copy(long newSize) |
boolean |
equals(java.lang.Object o) |
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
|
int |
getInt(long offset) |
long |
getLong(long offset) |
void |
put(long trgOffset,
Memory memory,
long srcOffset,
long size) |
void |
setByte(long offset,
byte b) |
void |
setBytes(long memoryOffset,
byte[] buffer,
int bufferOffset,
int count)
Transfers count bytes from buffer to Memory
|
void |
setBytes(long memoryOffset,
java.nio.ByteBuffer buffer) |
void |
setInt(long offset,
int l) |
void |
setLong(long offset,
long l) |
void |
setMemory(long offset,
long bytes,
byte b) |
void |
setShort(long offset,
short l) |
long |
size() |
java.lang.String |
toString() |
protected static java.lang.String |
toString(long peer,
long size) |
protected Memory(long bytes)
protected Memory(Memory copyOf)
public static Memory allocate(long bytes)
public void setByte(long offset, byte b)
public void setMemory(long offset, long bytes, byte b)
public void setLong(long offset, long l)
public void setInt(long offset, int l)
public void setShort(long offset, short l)
public void setBytes(long memoryOffset, java.nio.ByteBuffer buffer)
public void setBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count)
memoryOffset
- start offset in the memorybuffer
- the data bufferbufferOffset
- start offset of the buffercount
- number of bytes to transferpublic byte getByte(long offset)
public long getLong(long offset)
public int getInt(long offset)
public void getBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count)
memoryOffset
- start offset in the memorybuffer
- the data bufferbufferOffset
- start offset of the buffercount
- number of bytes to transfer@Inline protected void checkBounds(long start, long end)
public void put(long trgOffset, Memory memory, long srcOffset, long size)
public Memory copy(long newSize)
public void free()
public void close()
close
in interface java.lang.AutoCloseable
public long size()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.nio.ByteBuffer[] asByteBuffers(long offset, long length)
public java.lang.String toString()
toString
in class java.lang.Object
protected static java.lang.String toString(long peer, long size)
Copyright © 2017 The Apache Software Foundation