|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.realtime.RawMemoryAccess
A class permitting access to specific memory offsets within the process address space.
jRate programs should refer to RealtimeSystem's to determine if they are running on
big-endian or little-endian systems.
BYTE_ORDER field
Raw memory areas cannot contain references to Java objects.
| Constructor Summary | |
RawMemoryAccess(Object type,
long size)
Constructs a raw memory accessor associated to a memory area of the given memory type and size. |
|
RawMemoryAccess(Object type,
long base,
long size)
Constructs a raw memory accessor associated to a memory area of the given memory type and size, based at the given offset. |
|
| Method Summary | |
byte |
getByte(long offset)
Get the byte at the given offset. |
void |
getBytes(long offset,
byte[] bytes,
int low,
int number)
Get a consecutive sequence of bytes at the given offset. |
int |
getInt(long offset)
Get the int at the given offset. |
void |
getInts(long offset,
int[] ints,
int low,
int number)
Get a consecutive sequence of ints at the given offset. |
long |
getLong(long offset)
Get the long at the given offset. |
void |
getLongs(long offset,
long[] longs,
int low,
int number)
Get a consecutive sequence of longs at the given offset. |
long |
getMappedAddress()
Returns the virtual memory location at which this physical memory area is mapped. |
short |
getShort(long offset)
Get the short at the given offset. |
void |
getShorts(long offset,
short[] shorts,
int low,
int number)
Get a consecutive sequence of shorts at the given offset. |
long |
map()
Map the physical memory range into virtual memory. |
long |
map(long base)
Map the physical memory range into virtual memory. |
long |
map(long base,
long size)
Map the physical memory range into virtual memory. |
void |
setByte(long offset,
byte value)
Set the byte at the given offset. |
void |
setBytes(long offset,
byte[] bytes,
int low,
int number)
Set a consecutive sequence of bytes at the given offset. |
void |
setInt(long offset,
int value)
Set the int at the given offset. |
void |
setInts(long offset,
int[] ints,
int low,
int number)
Set a consecutive sequence of ints at the given offset. |
void |
setLong(long offset,
long value)
Set the long at the given offset. |
void |
setLongs(long offset,
long[] longs,
int low,
int number)
Set a consecutive sequence of longs at the given offset. |
void |
setShort(long offset,
short value)
Set the short at the given offset. |
void |
setShorts(long offset,
short[] shorts,
int low,
int number)
Set a consecutive sequence of shorts at the given offset. |
void |
unmap()
Unmap the physical memory range from virtual memory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RawMemoryAccess(Object type,
long size)
type - the memory typesize - the size of the memory area
SecurityException - the current execution context does
not have permission to access physical memory, or memory of the
given type
SizeOutOfBoundsException - the size is negative or too
large
UnsupportedPhysicalMemoryException - the hardware does
not support this type of memory
MemoryTypeConflictException - the type
parameter's attributes conflict with each other
OutOfMemoryError - the requested type of memory exists,
but there is not enough of it to satisfy the request
public RawMemoryAccess(Object type,
long base,
long size)
type - the memory typebase - the base offset of the memory areasize - the size of the memory area
SecurityException - the current execution context does
not have permission to access physical memory, or memory of the
given type
OffsetOutOfBoundsException - the address is invalid
SizeOutOfBoundsException - the size is negative or too
large
UnsupportedPhysicalMemoryException - the hardware does
not support this type of memory
MemoryTypeConflictException - the type
parameter's attributes conflict with each other or with the
specified base offset
OutOfMemoryError - the requested type of memory exists,
but there is not enough of it to satisfy the request| Method Detail |
public byte getByte(long offset)
offset - the memory offset to access
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void getBytes(long offset,
byte[] bytes,
int low,
int number)
offset - the memory offset to accessbytes - the array to copy bytes intolow - the offset into the array at which to start copyingnumber - the number of bytes to copy
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory areapublic int getInt(long offset)
offset - the memory offset to access
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void getInts(long offset,
int[] ints,
int low,
int number)
offset - the memory offset to accessints - the array to copy ints intolow - the offset into the array at which to start copyingnumber - the number of ints to copy
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory areapublic long getLong(long offset)
offset - the memory offset to access
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void getLongs(long offset,
long[] longs,
int low,
int number)
offset - the memory offset to accesslongs - the array to copy longs intolow - the offset into the array at which to start copyingnumber - the number of longs to copy
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory areapublic short getShort(long offset)
offset - the memory offset to access
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void getShorts(long offset,
short[] shorts,
int low,
int number)
offset - the memory offset to accessshorts - the array to copy shorts intolow - the offset into the array at which to start copyingnumber - the number of shorts to copy
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void setByte(long offset,
byte value)
offset - the memory offset to accessvalue - the value to assign the byte in memory
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void setBytes(long offset,
byte[] bytes,
int low,
int number)
offset - the memory offset to accessbytes - the array to copy bytes fromlow - the offset into the array at which to start copyingnumber - the number of bytes to copy
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void setInt(long offset,
int value)
offset - the memory offset to accessvalue - the value to assign the int in memory
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void setInts(long offset,
int[] ints,
int low,
int number)
offset - the memory offset to accessints - the array to copy ints fromlow - the offset into the array at which to start copyingnumber - the number of ints to copy
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void setLong(long offset,
long value)
offset - the memory offset to accessvalue - the value to assign the long in memory
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void setLongs(long offset,
long[] longs,
int low,
int number)
offset - the memory offset to accesslongs - the array to copy longs fromlow - the offset into the array at which to start copyingnumber - the number of longs to copy
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void setShort(long offset,
short value)
offset - the memory offset to accessvalue - the value to assign the short in memory
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory area
public void setShorts(long offset,
short[] shorts,
int low,
int number)
offset - the memory offset to accessshorts - the array to copy shorts fromlow - the offset into the array at which to start copyingnumber - the number of shorts to copy
OffsetOutOfBoundsException - the given offset is negative
or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would
require accessing storage beyond the end of the memory areapublic long getMappedAddress()
IllegalStateException - if this RawMemoryAccess
is in an unmapped statepublic long map()
OutOfMemoryError - there is insufficient free virtual
memory at the specified addresspublic long map(long base)
base - the virtual address to map at
OutOfMemoryError - there is insufficient free virtual
memory at the specified address
IllegalArgumentException - size is negative,
or base is an invalid virtual address
public long map(long base,
long size)
base - the virtual address to map atsize - the size of the block to map
OutOfMemoryError - there is insufficient free virtual
memory at the specified address
IllegalArgumentException - size is negative,
or base is an invalid virtual addresspublic void unmap()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||