|
Oracle Java Wireless Client | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RawBlock
The RawBlock
interface provides methods to access a continuous
range of physical memory (raw memory).
A RawBlock
instance can be obtained from a MMIODevice
instance.
index
values map to physical memory addresses.
The index
values are measured in bytes.
The index
values are relative to the base address of the raw memory area.
The index
value 0
corresponds to the base address
of raw memory area.
The byte ordering of the underlying raw memory area can be retrieved using the
MMIODevice.getByteOrdering()
method.
Method Summary | |
byte |
getByte(int index)
Reads the byte at the given index in the raw memory area associated with this object. |
void |
getBytes(int index,
byte[] dst,
int offset,
int length)
Reads byte s starting at the given index in the raw memory area associated with this object. |
int |
getInt(int index)
Reads the int at the given index in the raw memory area associated with this object. |
void |
getInts(int index,
int[] dst,
int offset,
int length)
Reads int s starting at the given index in the raw memory area associated with this object. |
long |
getLong(int index)
Reads the long at the given index in the raw memory area associated with this object. |
void |
getLongs(int index,
long[] dst,
int offset,
int length)
Reads long s starting at the given index in the raw memory area associated with this object. |
short |
getShort(int index)
Reads the short at the given index in the raw memory area associated with this object. |
void |
getShorts(int index,
short[] dst,
int offset,
int length)
Reads short s starting at the given index in the raw memory area associated with this object. |
void |
setByte(int index,
byte value)
Writes the given byte at the given index in the raw memory area associated with this object. |
void |
setBytes(int index,
byte[] src,
int offset,
int length)
Writes byte s starting at the given index in the raw memory area associated with this object. |
void |
setInt(int index,
int value)
Writes the given int at the given index in the raw memory area associated with this object. |
void |
setInts(int index,
int[] src,
int offset,
int length)
Writes int s starting at the given index in the raw memory area associated with this object. |
void |
setLong(int index,
long value)
Writes the given long at the given index in the raw memory area associated with this object. |
void |
setLongs(int index,
long[] src,
int offset,
int length)
Writes long s starting at the given index in the raw memory area associated with this object. |
void |
setShort(int index,
short value)
Writes the given short at the given index in the raw memory area associated with this object. |
void |
setShorts(int index,
short[] src,
int offset,
int length)
Writes short s starting at the given index in the raw memory area associated with this object. |
Methods inherited from interface com.oracle.deviceaccess.mmio.RawMemory |
getName |
Method Detail |
byte getByte(int index) throws PeripheralNotAvailableException
byte
at the given index in the raw memory area associated with this object.
index
- the byte index in the raw memory area from which the byte
will be read.
byte
at the given index in the raw memory area.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void getBytes(int index, byte[] dst, int offset, int length) throws PeripheralNotAvailableException
byte
s starting at the given index in the raw memory area associated with this object.
This method transfers byte
s from the raw memory area into the given destination array.
Each byte
is loaded from memory in a single atomic operation.
index
- the byte index in the raw memory area from which the byte
s will be read.dst
- the array into which byte
s are to be writtenoffset
- the offset within the array of the first byte
to be written; must be non-negative and no larger than dst.length
.length
- the maximum number of byte
s to be written to the given array; must be non-negative and no larger than dst.length - offset
.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
java.lang.IndexOutOfBoundsException
- if the preconditions on the offset
and length
parameters do not hold.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).int getInt(int index) throws PeripheralNotAvailableException
int
at the given index in the raw memory area associated with this object.
index
- the byte index in the raw memory area from which the int
will be read.
int
at the given index in the raw memory area.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void getInts(int index, int[] dst, int offset, int length) throws PeripheralNotAvailableException
int
s starting at the given index in the raw memory area associated with this object.
This method transfers int
s from the raw memory area into the given destination array.
Each byte is loaded from memory in a single atomic operation.
If the int
s are aligned on natural boundaries each int
is loaded from memory
in a single atomic operation. Groups of int
s may be loaded together, but this is unspecified.
index
- the byte index in the raw memory area from which the int
s will be read.dst
- the array into which int
s are to be writtenoffset
- the offset within the array of the first int
to be written; must be non-negative and no larger than dst.length
.length
- the maximum number of int
s to be written to the given array; must be non-negative and no larger than dst.length - offset
.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
java.lang.IndexOutOfBoundsException
- if the preconditions on the offset
and length
parameters do not hold.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).long getLong(int index) throws PeripheralNotAvailableException
long
at the given index in the raw memory area associated with this object.
If the long
is aligned on a natural boundary it is always loaded from memory
in a single atomic operation. If it is not aligned on a natural boundary it may not be loaded atomically, and
the number and order of the load operations is unspecified.
index
- the byte index in the raw memory area from which the long
will be read.
long
at the given index in the raw memory area.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void getLongs(int index, long[] dst, int offset, int length) throws PeripheralNotAvailableException
long
s starting at the given index in the raw memory area associated with this object.
This method transfers long
s from the raw memory area into the given destination array.
Each byte is loaded from memory in a single atomic operation.
The loads of long
s are not required to be atomic even if they are located on natural boundaries.
index
- the byte index in the raw memory area from which the long
s will be read.dst
- the array into which long
s are to be writtenoffset
- the offset within the array of the first long
to be written; must be non-negative and no larger than dst.length
.length
- the maximum number of long
s to be written to the given array; must be non-negative and no larger than dst.length - offset
.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
java.lang.IndexOutOfBoundsException
- if the preconditions on the offset
and length
parameters do not hold.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).short getShort(int index) throws PeripheralNotAvailableException
short
at the given index in the raw memory area associated with this object.
index
- the byte index in the raw memory area from which the short
will be read.
short
at the given index in the raw memory area.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void getShorts(int index, short[] dst, int offset, int length) throws PeripheralNotAvailableException
short
s starting at the given index in the raw memory area associated with this object.
This method transfers short
s from the raw memory area into the given destination array.
Each byte is loaded from memory in a single atomic operation.
If the short
s are aligned on natural boundaries each short
is loaded from memory
in a single atomic operation. Groups of short
s may be loaded together, but this is unspecified.
index
- the byte index in the raw memory area from which the short
s will be read.dst
- the array into which short
s are to be writtenoffset
- the offset within the array of the first short
to be written; must be non-negative and no larger than dst.length
.length
- the maximum number of short
s to be written to the given array; must be non-negative and no larger than dst.length - offset
.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
java.lang.IndexOutOfBoundsException
- if the preconditions on the offset
and length
parameters do not hold.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void setByte(int index, byte value) throws PeripheralNotAvailableException
byte
at the given index in the raw memory area associated with this object.
This memory access may involve a load and a store, and it may have unspecified
effects on surrounding bytes in the presence of concurrent access.
index
- the byte index in the raw memory area at which the byte
will be written.value
- the byte
to be written at the given index in the raw memory area.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void setBytes(int index, byte[] src, int offset, int length) throws PeripheralNotAvailableException
byte
s starting at the given index in the raw memory area associated with this object.
This method transfers byte
s from the given source array into the raw memory area.
This memory access may involve multiple load and a store operations, and it may have unspecified
effects on surrounding bytes (even bytes in the range being stored)
in the presence of concurrent access.
index
- the byte index in the raw memory area at which the byte
s will be written.src
- the array from which byte
s are to be read.offset
- the offset within the array of the first byte
to be read; must be non-negative and no larger than src.length
.length
- the maximum number of byte
s to be written to the given array; must be non-negative and no larger than src.length - offset
.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
java.lang.IndexOutOfBoundsException
- if the preconditions on the offset
and length
parameters do not hold.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void setInt(int index, int value) throws PeripheralNotAvailableException
int
at the given index in the raw memory area associated with this object.
This memory access may involve a load and a store, and it may have unspecified
effects on surrounding bytes in the presence of concurrent access.
index
- the byte index in the raw memory area from which the int
will be written.value
- the int
to be written at the given index in the raw memory area.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void setInts(int index, int[] src, int offset, int length) throws PeripheralNotAvailableException
int
s starting at the given index in the raw memory area associated with this object.
This method transfers int
s from the given source array into the raw memory area.
This memory access may involve multiple load and a store operations, and it may have unspecified
effects on surrounding bytes (even bytes in the range being stored)
in the presence of concurrent access.
index
- the byte index in the raw memory area at which the int
s will be written.src
- the array from which int
s are to be read.offset
- the offset within the array of the first int
to be read; must be non-negative and no larger than src.length
.length
- the maximum number of int
s to be written to the given array; must be non-negative and no larger than src.length - offset
.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
java.lang.IndexOutOfBoundsException
- if the preconditions on the offset
and length
parameters do not hold.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void setLong(int index, long value) throws PeripheralNotAvailableException
long
at the given index in the raw memory area associated with this object.
This memory access may involve a load and a store, and it may have unspecified
effects on surrounding bytes in the presence of concurrent access.
index
- the byte index in the raw memory area from which the long
will be written.value
- the long
to be written at the given index in the raw memory area.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void setLongs(int index, long[] src, int offset, int length) throws PeripheralNotAvailableException
long
s starting at the given index in the raw memory area associated with this object.
This method transfers long
s from the given source array into the raw memory area.
This memory access may involve multiple load and a store operations, and it may have unspecified
effects on surrounding bytes (even bytes in the range being stored)
in the presence of concurrent access.
index
- the byte index in the raw memory area at which the long
s will be written.src
- the array from which long
s are to be read.offset
- the offset within the array of the first long
to be read; must be non-negative and no larger than src.length
.length
- the maximum number of long
s to be written to the given array; must be non-negative and no larger than src.length - offset
.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
java.lang.IndexOutOfBoundsException
- if the preconditions on the offset
and length
parameters do not hold.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void setShort(int index, short value) throws PeripheralNotAvailableException
short
at the given index in the raw memory area associated with this object.
This memory access may involve a load and a store, and it may have unspecified
effects on surrounding bytes in the presence of concurrent access.
index
- the byte index in the raw memory area from which the short
will be written.value
- the short
to be written at the given index in the raw memory area.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).void setShorts(int index, short[] src, int offset, int length) throws PeripheralNotAvailableException
short
s starting at the given index in the raw memory area associated with this object.
This method transfers short
s from the given source array into the raw memory area.
This memory access may involve multiple load and a store operations, and it may have unspecified
effects on surrounding bytes (even bytes in the range being stored)
in the presence of concurrent access.
index
- the byte index in the raw memory area at which the short
s will be written.src
- the array from which short
s are to be read.offset
- the offset within the array of the first short
to be read; must be non-negative and no larger than src.length
.length
- the maximum number of short
s to be written to the given array; must be non-negative and no larger than src.length - offset
.
AccessOutOfBoundsException
- if index
would result in pointing outside the raw memory area associated with this object.
java.lang.IndexOutOfBoundsException
- if the preconditions on the offset
and length
parameters do not hold.
PeripheralNotAvailableException
- if the peripheral is not currently available (has been released).
|
Oracle Java Wireless Client | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |