public abstract class AbstractArrayMemoryIO extends AbstractMemoryIO
限定符和类型 | 类和说明 |
---|---|
protected static class |
AbstractArrayMemoryIO.ArrayIO |
限定符 | 构造器和说明 |
---|---|
protected |
AbstractArrayMemoryIO(Runtime runtime,
byte[] buffer) |
protected |
AbstractArrayMemoryIO(Runtime runtime,
byte[] buffer,
int offset,
int length) |
protected |
AbstractArrayMemoryIO(Runtime runtime,
int size) |
限定符和类型 | 方法和说明 |
---|---|
byte[] |
array()
Returns the array that backs this pointer.
|
int |
arrayLength()
Returns the length of this pointer's backing array that is used by this pointer.
|
int |
arrayOffset()
Returns the offset within this pointer's backing array of the first element.
|
void |
clear() |
void |
get(long offset,
byte[] dst,
int off,
int len)
Bulk get method for multiple
byte values. |
void |
get(long offset,
double[] dst,
int off,
int len)
Bulk get method for multiple
double values. |
void |
get(long offset,
float[] dst,
int off,
int len)
Bulk get method for multiple
float values. |
void |
get(long offset,
int[] dst,
int off,
int len)
Bulk get method for multiple
int values. |
void |
get(long offset,
long[] dst,
int off,
int len)
Bulk get method for multiple
long values. |
void |
get(long offset,
short[] dst,
int off,
int len)
Bulk get method for multiple
short values. |
long |
getAddress(long offset)
Reads a native memory address value at the given offset.
|
protected AbstractArrayMemoryIO.ArrayIO |
getArrayIO() |
byte |
getByte(long offset)
Reads an
byte (8 bit) value at the given offset. |
double |
getDouble(long offset)
Reads a
double (64 bit) value at the given offset. |
float |
getFloat(long offset)
Reads a
float (32 bit) value at the given offset. |
int |
getInt(long offset)
Reads an
int (32 bit) value at the given offset. |
long |
getLongLong(long offset)
Reads a
long (64 bit) value at the given offset. |
short |
getShort(long offset)
Reads a
short (16 bit) value at the given offset. |
String |
getString(long offset)
Reads an
String value at the given offset. |
String |
getString(long offset,
int maxLength,
Charset cs)
Reads a
String value at the given offset, using a specific Charset |
boolean |
hasArray()
Indicates whether this
Pointer instance is backed by an array. |
protected int |
index(long off) |
int |
indexOf(long offset,
byte value)
Returns the location of a byte value within the memory area represented by this
Pointer . |
int |
indexOf(long offset,
byte value,
int maxlen)
Returns the location of a byte value within the memory area represented by this
Pointer . |
boolean |
isNull() |
int |
length() |
int |
offset() |
void |
put(long offset,
byte[] src,
int off,
int len)
Bulk put method for multiple
byte values. |
void |
put(long offset,
double[] src,
int off,
int len)
Bulk put method for multiple
double values. |
void |
put(long offset,
float[] src,
int off,
int len)
Bulk put method for multiple
float values. |
void |
put(long offset,
int[] src,
int off,
int len)
Bulk put method for multiple
int values. |
void |
put(long offset,
long[] src,
int off,
int len)
Bulk put method for multiple
long values. |
void |
put(long offset,
short[] src,
int off,
int len)
Bulk put method for multiple
short values. |
void |
putAddress(long offset,
long value)
Writes a native memory address value at the given offset.
|
void |
putByte(long offset,
byte value)
Writes a
byte (8 bit) value at the given offset. |
void |
putDouble(long offset,
double value)
Writes a
double (64 bit, double precision) value at the given offset. |
void |
putFloat(long offset,
float value)
Writes a
float (32 bit, single precision) value at the given offset. |
void |
putInt(long offset,
int value)
Writes an
int (32 bit) value at the given offset. |
void |
putLongLong(long offset,
long value)
Writes a
long (64 bit) value at the given offset. |
void |
putShort(long offset,
short value)
Writes a
short (16 bit) value at the given offset. |
void |
putString(long offset,
String string,
int maxLength,
Charset cs)
Writes a
String value at the given offset, using a specific Charset |
void |
putZeroTerminatedByteArray(long offset,
byte[] src,
int off,
int len) |
protected int |
remaining(long offset) |
void |
setMemory(long offset,
long size,
byte value)
Sets the value of each byte in the memory area represented by this
Pointer . |
long |
size()
Gets the size of this memory object in bytes (optional operation).
|
checkBounds, checkBounds, getInt, getLong, getNativeLong, putAddress, putInt, putLong, putNativeLong, slice, slice, transferFrom, transferTo
address, get, getNullTerminatedPointerArray, getNullTerminatedStringArray, getPointer, getPointer, getRuntime, isDirect, newIntPointer, put, putPointer, toString, wrap, wrap, wrap
protected final byte[] buffer
protected final int offset
protected final int length
protected AbstractArrayMemoryIO(Runtime runtime, byte[] buffer, int offset, int length)
protected AbstractArrayMemoryIO(Runtime runtime, byte[] buffer)
protected AbstractArrayMemoryIO(Runtime runtime, int size)
protected final AbstractArrayMemoryIO.ArrayIO getArrayIO()
public final byte[] array()
Pointer
public final int offset()
public final int length()
public final int arrayLength()
Pointer
arrayLength
在类中 Pointer
public final int arrayOffset()
Pointer
arrayOffset
在类中 Pointer
public final boolean hasArray()
Pointer
Pointer
instance is backed by an array.public final long size()
Pointer
size
在类中 Pointer
Pointer
points to. If
the size is unknown, Long.MAX_VALUE
is returned}.protected final int index(long off)
protected final int remaining(long offset)
public final boolean isNull()
public String getString(long offset)
Pointer
String
value at the given offset.public String getString(long offset, int maxLength, Charset cs)
Pointer
String
value at the given offset, using a specific Charset
public void putString(long offset, String string, int maxLength, Charset cs)
Pointer
String
value at the given offset, using a specific Charset
public void putZeroTerminatedByteArray(long offset, byte[] src, int off, int len)
public final byte getByte(long offset)
Pointer
byte
(8 bit) value at the given offset.public final short getShort(long offset)
Pointer
short
(16 bit) value at the given offset.public final int getInt(long offset)
Pointer
int
(32 bit) value at the given offset.public final long getLongLong(long offset)
Pointer
long
(64 bit) value at the given offset.getLongLong
在类中 Pointer
offset
- The offset from the start of the memory this Pointer
represents at which the value will be read.long
value at the offset.public final long getAddress(long offset)
Pointer
A native address can be either 32 or 64 bits in size, depending on the cpu architecture.
getAddress
在类中 AbstractMemoryIO
offset
- The offset from the start of the memory this Pointer
represents at which the value will be read.Address
public final float getFloat(long offset)
Pointer
float
(32 bit) value at the given offset.public final double getDouble(long offset)
Pointer
double
(64 bit) value at the given offset.public final void putByte(long offset, byte value)
Pointer
byte
(8 bit) value at the given offset.public final void putShort(long offset, short value)
Pointer
short
(16 bit) value at the given offset.public final void putInt(long offset, int value)
Pointer
int
(32 bit) value at the given offset.public final void putLongLong(long offset, long value)
Pointer
long
(64 bit) value at the given offset.putLongLong
在类中 Pointer
offset
- The offset from the start of the memory this Pointer
represents at which the value will be written.value
- the long
value to be written.public final void putAddress(long offset, long value)
Pointer
A native address can be either 32 or 64 bits in size, depending on the cpu architecture.
putAddress
在类中 AbstractMemoryIO
offset
- The offset from the start of the memory this Pointer
represents at which the value will be written.value
- The native address value to be written.Address
public final void putFloat(long offset, float value)
Pointer
float
(32 bit, single precision) value at the given offset.public final void putDouble(long offset, double value)
Pointer
double
(64 bit, double precision) value at the given offset.public final void get(long offset, byte[] dst, int off, int len)
Pointer
byte
values.
This method reads multiple byte
values from consecutive addresses,
beginning at the given offset, and stores them in an array.public final void put(long offset, byte[] src, int off, int len)
Pointer
byte
values.
This method writes multiple byte
values to consecutive addresses,
beginning at the given offset, from an array.public final void get(long offset, short[] dst, int off, int len)
Pointer
short
values.
This method reads multiple short
values from consecutive addresses,
beginning at the given offset, and stores them in an array.public final void put(long offset, short[] src, int off, int len)
Pointer
short
values.
This method writes multiple short
values to consecutive addresses,
beginning at the given offset, from an array.public final void get(long offset, int[] dst, int off, int len)
Pointer
int
values.
This method reads multiple int
values from consecutive addresses,
beginning at the given offset, and stores them in an array.public final void put(long offset, int[] src, int off, int len)
Pointer
int
values.
This method writes multiple int
values to consecutive addresses,
beginning at the given offset, from an array.public final void get(long offset, long[] dst, int off, int len)
Pointer
long
values.
This method reads multiple long
values from consecutive addresses,
beginning at the given offset, and stores them in an array.public final void put(long offset, long[] src, int off, int len)
Pointer
long
values.
This method writes multiple long
values to consecutive addresses,
beginning at the given offset, from an array.public final void get(long offset, float[] dst, int off, int len)
Pointer
float
values.
This method reads multiple float
values from consecutive addresses,
beginning at the given offset, and stores them in an array.public final void put(long offset, float[] src, int off, int len)
Pointer
float
values.
This method writes multiple float
values to consecutive addresses,
beginning at the given offset, from an array.public final void get(long offset, double[] dst, int off, int len)
Pointer
double
values.
This method reads multiple double
values from consecutive addresses,
beginning at the given offset, and stores them in an array.public final void put(long offset, double[] src, int off, int len)
Pointer
double
values.
This method writes multiple double
values to consecutive addresses,
beginning at the given offset, from an array.public final int indexOf(long offset, byte value)
Pointer
Pointer
.indexOf
在类中 AbstractMemoryIO
offset
- the offset from the start of the memory location this Pointer
represents to begin searching.value
- the byte
value to locate.public final int indexOf(long offset, byte value, int maxlen)
Pointer
Pointer
.indexOf
在类中 Pointer
offset
- the offset from the start of the memory location this Pointer
represents to begin searching.value
- the byte
value to locate.maxlen
- the maximum number of bytes to search for the desired value.public final void setMemory(long offset, long size, byte value)
Pointer
Pointer
.
to a specified value.public final void clear()
Copyright © 2021. All rights reserved.