public abstract class MemoryIO extends java.lang.Object implements Pointer
Constructor and Description |
---|
MemoryIO() |
Modifier and Type | Method and Description |
---|---|
abstract long |
address()
Gets the native address of this memory object (optional operation).
|
static MemoryIO |
allocate(int size)
Allocates a new block of java heap memory and wraps it in a
MemoryIO
accessor. |
static MemoryIO |
allocateDirect(int size)
Allocates a new block of native memory and wraps it in a
MemoryIO
accessor. |
static MemoryIO |
allocateDirect(int size,
boolean clear)
Allocates a new block of native memory and wraps it in a
MemoryIO
accessor. |
abstract void |
get(long offset,
byte[] dst,
int idx,
int len)
Bulk byte get method.
|
abstract void |
get(long offset,
double[] dst,
int idx,
int len)
Bulk double get method.
|
abstract void |
get(long offset,
float[] dst,
int idx,
int len)
Bulk float get method.
|
abstract void |
get(long offset,
int[] dst,
int idx,
int len)
Bulk int get method.
|
abstract void |
get(long offset,
long[] dst,
int idx,
int len)
Bulk long get method.
|
abstract void |
get(long offset,
short[] dst,
int idx,
int len)
Bulk short get method.
|
abstract long |
getAddress(long offset) |
abstract byte |
getByte(long offset)
Reads a 8 bit integer at the given offset.
|
abstract double |
getDouble(long offset)
Reads a 64 bit floating point value at the given offset.
|
abstract float |
getFloat(long offset)
Reads a 32 bit floating point value at the given offset.
|
abstract int |
getInt(long offset)
Reads a 32 bit integer at the given offset.
|
abstract long |
getLong(long offset)
Reads a 64 bit integer at the given offset.
|
abstract MemoryIO |
getMemoryIO(long offset) |
abstract MemoryIO |
getMemoryIO(long offset,
long size) |
abstract long |
getNativeLong(long offset) |
abstract Pointer |
getPointer(long offset) |
abstract short |
getShort(long offset)
Reads a 16 bit integer at the given offset.
|
abstract java.lang.String |
getString(long offset) |
abstract java.lang.String |
getString(long offset,
int maxLength,
java.nio.charset.Charset cs) |
abstract int |
indexOf(long offset,
byte value) |
abstract int |
indexOf(long offset,
byte value,
int maxlen) |
abstract boolean |
isDirect()
Tells whether or not this memory object is direct.
|
abstract void |
put(long offset,
byte[] src,
int idx,
int len)
Bulk byte put method.
|
abstract void |
put(long offset,
double[] src,
int idx,
int len)
Bulk double put method.
|
abstract void |
put(long offset,
float[] src,
int idx,
int len)
Bulk float put method.
|
abstract void |
put(long offset,
int[] src,
int idx,
int len)
Bulk int put method.
|
abstract void |
put(long offset,
long[] src,
int idx,
int len)
Bulk long put method.
|
abstract void |
put(long offset,
short[] src,
int idx,
int len)
Bulk short put method.
|
abstract void |
putAddress(long offset,
Address value) |
abstract void |
putAddress(long offset,
long value) |
abstract void |
putByte(long offset,
byte value)
Writes an 8 bit integer value at the given offset.
|
abstract void |
putDouble(long offset,
double value)
Writes a 64 bit floating point value at the given offset.
|
abstract void |
putFloat(long offset,
float value)
Writes a 32 bit floating point value at the given offset.
|
abstract void |
putInt(long offset,
int value)
Writes a 32 bit integer value at the given offset.
|
abstract void |
putLong(long offset,
long value)
Writes a 64 bit integer value at the given offset.
|
abstract void |
putNativeLong(long offset,
long value) |
abstract void |
putPointer(long offset,
Pointer value) |
abstract void |
putShort(long offset,
short value)
Writes a 16 bit integer value at the given offset.
|
abstract void |
putString(long offset,
java.lang.String string,
int maxLength,
java.nio.charset.Charset cs) |
abstract void |
setMemory(long offset,
long size,
byte value) |
abstract MemoryIO |
slice(long offset) |
abstract MemoryIO |
slice(long offset,
long size) |
abstract void |
transferTo(long offset,
MemoryIO other,
long otherOffset,
long count) |
static MemoryIO |
wrap(java.nio.ByteBuffer buffer) |
static MemoryIO |
wrap(Pointer ptr) |
static MemoryIO |
wrap(Pointer ptr,
int size) |
public static final MemoryIO allocate(int size)
MemoryIO
accessor.size
- The size in bytes of memory to allocate.public static final MemoryIO allocateDirect(int size)
MemoryIO
accessor.size
- The size in bytes of memory to allocate.public static final MemoryIO allocateDirect(int size, boolean clear)
MemoryIO
accessor.size
- The size in bytes of memory to allocate.clear
- Whether the memory contents should be cleared, or left as
random data.public static final MemoryIO wrap(java.nio.ByteBuffer buffer)
public abstract byte getByte(long offset)
public abstract short getShort(long offset)
public abstract int getInt(long offset)
public abstract long getLong(long offset)
public abstract float getFloat(long offset)
public abstract double getDouble(long offset)
public abstract void putByte(long offset, byte value)
public abstract void putShort(long offset, short value)
public abstract void putInt(long offset, int value)
public abstract void putLong(long offset, long value)
public abstract void putFloat(long offset, float value)
public abstract void putDouble(long offset, double value)
public abstract void get(long offset, byte[] dst, int idx, int len)
public abstract void put(long offset, byte[] src, int idx, int len)
public abstract void get(long offset, short[] dst, int idx, int len)
public abstract void put(long offset, short[] src, int idx, int len)
public abstract void get(long offset, int[] dst, int idx, int len)
public abstract void put(long offset, int[] src, int idx, int len)
public abstract void get(long offset, long[] dst, int idx, int len)
public abstract void put(long offset, long[] src, int idx, int len)
public abstract void get(long offset, float[] dst, int idx, int len)
public abstract void put(long offset, float[] src, int idx, int len)
public abstract void get(long offset, double[] dst, int idx, int len)
public abstract void put(long offset, double[] src, int idx, int len)
public abstract MemoryIO getMemoryIO(long offset)
public abstract MemoryIO getMemoryIO(long offset, long size)
public abstract Pointer getPointer(long offset)
getPointer
in interface Pointer
public abstract void putPointer(long offset, Pointer value)
putPointer
in interface Pointer
public abstract int indexOf(long offset, byte value)
public abstract int indexOf(long offset, byte value, int maxlen)
public abstract long getAddress(long offset)
public abstract void putAddress(long offset, long value)
public abstract void putAddress(long offset, Address value)
public abstract long getNativeLong(long offset)
public abstract void putNativeLong(long offset, long value)
public abstract java.lang.String getString(long offset, int maxLength, java.nio.charset.Charset cs)
public abstract java.lang.String getString(long offset)
public abstract void putString(long offset, java.lang.String string, int maxLength, java.nio.charset.Charset cs)
public abstract MemoryIO slice(long offset)
public abstract MemoryIO slice(long offset, long size)
public abstract void transferTo(long offset, MemoryIO other, long otherOffset, long count)
public abstract void setMemory(long offset, long size, byte value)
public abstract boolean isDirect()
public abstract long address()