|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.kenai.jaffl.MemoryIO
public abstract class MemoryIO
Interface to reading/writing various types of memory
Field Summary |
---|
Fields inherited from interface com.kenai.jaffl.Pointer |
---|
SIZE |
Constructor Summary | |
---|---|
MemoryIO()
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemoryIO()
Method Detail |
---|
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(Pointer ptr)
public static final MemoryIO wrap(Pointer ptr, int size)
public static final MemoryIO wrap(java.nio.ByteBuffer buffer)
public abstract byte getByte(long offset)
getByte
in interface Pointer
offset
- The offset from which the integer will be read.
public abstract short getShort(long offset)
getShort
in interface Pointer
offset
- The offset from which the integer will be read.
public abstract int getInt(long offset)
getInt
in interface Pointer
offset
- The offset from which the integer will be read.
public abstract long getLong(long offset)
getLong
in interface Pointer
offset
- The offset from which the integer will be read.
public abstract float getFloat(long offset)
getFloat
in interface Pointer
offset
- The offset from which the integer will be read.
public abstract double getDouble(long offset)
getDouble
in interface Pointer
offset
- The offset from which the integer will be read.
public abstract void putByte(long offset, byte value)
putByte
in interface Pointer
offset
- The offset at which the value will be written.value
- The value to be written.public abstract void putShort(long offset, short value)
putShort
in interface Pointer
offset
- The offset at which the value will be written.value
- The value to be written.public abstract void putInt(long offset, int value)
putInt
in interface Pointer
offset
- The offset at which the value will be written.value
- The value to be written.public abstract void putLong(long offset, long value)
putLong
in interface Pointer
offset
- The offset at which the value will be written.value
- The value to be written.public abstract void putFloat(long offset, float value)
putFloat
in interface Pointer
offset
- The offset at which the value will be written.value
- The value to be written.public abstract void putDouble(long offset, double value)
putDouble
in interface Pointer
offset
- The offset at which the value will be written.value
- The value to be written.public abstract void get(long offset, byte[] dst, int idx, int len)
get
in interface Pointer
offset
- The offset at which the values will be read.dst
- The array into which values are to be written.idx
- The index within the destination array of the first value to be written.len
- The number of values to be written to the destination array.public abstract void put(long offset, byte[] src, int idx, int len)
put
in interface Pointer
offset
- The offset at which the values will be written.src
- The source array from which values are to be read.idx
- The index within the destination array of the first value to be read.len
- The number of values to be read from the source array.public abstract void get(long offset, short[] dst, int idx, int len)
get
in interface Pointer
offset
- The offset at which the values will be read.dst
- The array into which values are to be written.idx
- The index within the destination array of the first value to be written.len
- The number of values to be written to the destination array.public abstract void put(long offset, short[] src, int idx, int len)
put
in interface Pointer
offset
- The offset at which the values will be written.src
- The source array from which values are to be read.idx
- The index within the destination array of the first value to be read.len
- The number of values to be read from the source array.public abstract void get(long offset, int[] dst, int idx, int len)
get
in interface Pointer
offset
- The offset at which the values will be read.dst
- The array into which values are to be written.idx
- The index within the destination array of the first value to be written.len
- The number of values to be written to the destination array.public abstract void put(long offset, int[] src, int idx, int len)
put
in interface Pointer
offset
- The offset at which the values will be written.src
- The source array from which values are to be read.idx
- The index within the destination array of the first value to be read.len
- The number of values to be read from the source array.public abstract void get(long offset, long[] dst, int idx, int len)
get
in interface Pointer
offset
- The offset at which the values will be read.dst
- The array into which values are to be written.idx
- The index within the destination array of the first value to be written.len
- The number of values to be written to the destination array.public abstract void put(long offset, long[] src, int idx, int len)
put
in interface Pointer
offset
- The offset at which the values will be written.src
- The source array from which values are to be read.idx
- The index within the destination array of the first value to be read.len
- The number of values to be read from the source array.public abstract void get(long offset, float[] dst, int idx, int len)
get
in interface Pointer
offset
- The offset at which the values will be read.dst
- The array into which values are to be written.idx
- The index within the destination array of the first value to be written.len
- The number of values to be written to the destination array.public abstract void put(long offset, float[] src, int idx, int len)
put
in interface Pointer
offset
- The offset at which the values will be written.src
- The source array from which values are to be read.idx
- The index within the destination array of the first value to be read.len
- The number of values to be read from the source array.public abstract void get(long offset, double[] dst, int idx, int len)
get
in interface Pointer
offset
- The offset at which the values will be read.dst
- The array into which values are to be written.idx
- The index within the destination array of the first value to be written.len
- The number of values to be written to the destination array.public abstract void put(long offset, double[] src, int idx, int len)
put
in interface Pointer
offset
- The offset at which the values will be written.src
- The source array from which values are to be read.idx
- The index within the destination array of the first value to be read.len
- The number of values to be read from the source array.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)
getString
in interface Pointer
public abstract java.lang.String getString(long offset)
getString
in interface Pointer
public abstract void putString(long offset, java.lang.String string, int maxLength, java.nio.charset.Charset cs)
putString
in interface Pointer
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()
isDirect
in interface Pointer
public abstract long address()
address
in interface Pointer
java.lang.UnsupportedOperationException
- If this memory object is not backed by native memory.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |