|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RawByteWriter
A marker for a byte accessor object encapsulating the protocol for writing bytes from raw memory. A byte accessor can always access at least one byte. Each byte is transfered in a single atomic operation. Groups of bytes may be transfered together; however, this is not required.
Objects of this type are created with the method
RawMemoryFactory.createRawByteWriter(javax.realtime.device.RawMemoryRegion, long, int, int)
and
RawMemoryFactory.createRawByte(javax.realtime.device.RawMemoryRegion, long, int, int)
. Each object references
a range of elements in the RawMemoryRegion
starting at the
base address provided to the factory method. The size provided
to the factor method determines the number of elements accessable.
Caching of the memory access is controlled by the factory that created this object. If the memory is not cached, this method guarantees serialized access. In other words, the memory access at the memory occurs in the same order as in the program. Multiple writes to the same location may not be coalesced.
Method Summary | |
---|---|
int |
set(int offset,
byte[] values)
Copy values to the raw memory starting at the address
referenced by this instance plus the offset scaled by the
element size in bytes and the objects stride. |
int |
set(int offset,
byte[] values,
int start,
int count)
Copy values to the memory region, where
offset is first byte in the memory region to write and
start is the first index in values from
which to read. |
void |
setByte(byte value)
Set the value at the first position referenced by this instance, i.e., the value at its start address. |
void |
setByte(int offset,
byte value)
Set the value of the nth element referenced by this instance, where n is offset and the
address is base address + offset
× size of Byte. |
Methods inherited from interface javax.realtime.device.RawMemory |
---|
getAddress, getSize, getStride |
Method Detail |
---|
void setByte(byte value)
void setByte(int offset, byte value) throws OffsetOutOfBoundsException
n
is offset
and the
address is base address + offset
× size of Byte. This operation must be atomic with
respect to all other raw memory accesses to the address. When an
exception is thrown, no data is transfered.
offset
- of byte in the memory region.
OffsetOutOfBoundsException
- when offset
is
negative or greater than or equal to the number of elements in the
raw memory region.int set(int offset, byte[] values) throws OffsetOutOfBoundsException, NullPointerException
values
to the raw memory starting at the address
referenced by this instance plus the offset
scaled by the
element size in bytes and the objects stride. Only the bytes
in the intersection of values
and the end of the memory
region are transfered. When an exception is thrown, no data is transfered.
values
OffsetOutOfBoundsException
- when offset
is
negative or greater than or equal to the number of elements in the
raw memory region.
NullPointerException
- when values
is null.int set(int offset, byte[] values, int start, int count) throws OffsetOutOfBoundsException, ArrayIndexOutOfBoundsException, IllegalArgumentException, NullPointerException
values
to the memory region, where
offset
is first byte in the memory region to write and
start
is the first index in values
from
which to read. The number of bytes transfered is the minimum of
count
, the size of the memory region minus
offset
, and length of values
minus
start
. When an exception is thrown, no data is transfered.
offset
- of the first byte in the memory region to transferevalues
- the array to received the bytesstart
- the first index in array to fillcount
- the maximum number of bytes to copy
OffsetOutOfBoundsException
- when offset
is
negative or greater than or equal to the number of elements in the
raw memory area.
ArrayIndexOutOfBoundsException
- when start
is
negative or either start
or start + count
is greater than or equal to the size of values.
IllegalArgumentException
- when count
is negative.
NullPointerException
- when values
is null.
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |