Oracle Java Wireless Client

com.oracle.deviceaccess.mmio
Interface RawBlock

All Superinterfaces:
RawMemory

public interface RawBlock
extends RawMemory

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.

The 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 bytes 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 ints 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 longs 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 shorts 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 bytes 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 ints 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 longs 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 shorts 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

getByte

byte getByte(int index)
             throws PeripheralNotAvailableException
Reads the byte at the given index in the raw memory area associated with this object.

Parameters:
index - the byte index in the raw memory area from which the byte will be read.
Returns:
The byte at the given index in the raw memory area.
Throws:
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).

getBytes

void getBytes(int index,
              byte[] dst,
              int offset,
              int length)
              throws PeripheralNotAvailableException
Reads bytes starting at the given index in the raw memory area associated with this object. This method transfers bytes from the raw memory area into the given destination array. Each byte is loaded from memory in a single atomic operation.

Parameters:
index - the byte index in the raw memory area from which the bytes will be read.
dst - the array into which bytes are to be written
offset - 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 bytes to be written to the given array; must be non-negative and no larger than dst.length - offset.
Throws:
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).

getInt

int getInt(int index)
           throws PeripheralNotAvailableException
Reads the int at the given index in the raw memory area associated with this object.

Parameters:
index - the byte index in the raw memory area from which the int will be read.
Returns:
The int at the given index in the raw memory area.
Throws:
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).

getInts

void getInts(int index,
             int[] dst,
             int offset,
             int length)
             throws PeripheralNotAvailableException
Reads ints starting at the given index in the raw memory area associated with this object. This method transfers ints from the raw memory area into the given destination array. Each byte is loaded from memory in a single atomic operation.

If the ints are aligned on natural boundaries each int is loaded from memory in a single atomic operation. Groups of ints may be loaded together, but this is unspecified.

Parameters:
index - the byte index in the raw memory area from which the ints will be read.
dst - the array into which ints are to be written
offset - 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 ints to be written to the given array; must be non-negative and no larger than dst.length - offset.
Throws:
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).

getLong

long getLong(int index)
             throws PeripheralNotAvailableException
Reads the 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.

Parameters:
index - the byte index in the raw memory area from which the long will be read.
Returns:
The long at the given index in the raw memory area.
Throws:
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).

getLongs

void getLongs(int index,
              long[] dst,
              int offset,
              int length)
              throws PeripheralNotAvailableException
Reads longs starting at the given index in the raw memory area associated with this object. This method transfers longs from the raw memory area into the given destination array. Each byte is loaded from memory in a single atomic operation.

The loads of longs are not required to be atomic even if they are located on natural boundaries.

Parameters:
index - the byte index in the raw memory area from which the longs will be read.
dst - the array into which longs are to be written
offset - 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 longs to be written to the given array; must be non-negative and no larger than dst.length - offset.
Throws:
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).

getShort

short getShort(int index)
               throws PeripheralNotAvailableException
Reads the short at the given index in the raw memory area associated with this object.

Parameters:
index - the byte index in the raw memory area from which the short will be read.
Returns:
The short at the given index in the raw memory area.
Throws:
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).

getShorts

void getShorts(int index,
               short[] dst,
               int offset,
               int length)
               throws PeripheralNotAvailableException
Reads shorts starting at the given index in the raw memory area associated with this object. This method transfers shorts from the raw memory area into the given destination array. Each byte is loaded from memory in a single atomic operation.

If the shorts are aligned on natural boundaries each short is loaded from memory in a single atomic operation. Groups of shorts may be loaded together, but this is unspecified.

Parameters:
index - the byte index in the raw memory area from which the shorts will be read.
dst - the array into which shorts are to be written
offset - 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 shorts to be written to the given array; must be non-negative and no larger than dst.length - offset.
Throws:
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).

setByte

void setByte(int index,
             byte value)
             throws PeripheralNotAvailableException
Writes the given 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.

Parameters:
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.
Throws:
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).

setBytes

void setBytes(int index,
              byte[] src,
              int offset,
              int length)
              throws PeripheralNotAvailableException
Writes bytes starting at the given index in the raw memory area associated with this object. This method transfers bytes 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.

Parameters:
index - the byte index in the raw memory area at which the bytes will be written.
src - the array from which bytes 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 bytes to be written to the given array; must be non-negative and no larger than src.length - offset.
Throws:
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).

setInt

void setInt(int index,
            int value)
            throws PeripheralNotAvailableException
Writes the given 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.

Parameters:
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.
Throws:
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).

setInts

void setInts(int index,
             int[] src,
             int offset,
             int length)
             throws PeripheralNotAvailableException
Writes ints starting at the given index in the raw memory area associated with this object. This method transfers ints 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.

Parameters:
index - the byte index in the raw memory area at which the ints will be written.
src - the array from which ints 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 ints to be written to the given array; must be non-negative and no larger than src.length - offset.
Throws:
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).

setLong

void setLong(int index,
             long value)
             throws PeripheralNotAvailableException
Writes the given 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.

Parameters:
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.
Throws:
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).

setLongs

void setLongs(int index,
              long[] src,
              int offset,
              int length)
              throws PeripheralNotAvailableException
Writes longs starting at the given index in the raw memory area associated with this object. This method transfers longs 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.

Parameters:
index - the byte index in the raw memory area at which the longs will be written.
src - the array from which longs 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 longs to be written to the given array; must be non-negative and no larger than src.length - offset.
Throws:
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).

setShort

void setShort(int index,
              short value)
              throws PeripheralNotAvailableException
Writes the given 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.

Parameters:
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.
Throws:
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).

setShorts

void setShorts(int index,
               short[] src,
               int offset,
               int length)
               throws PeripheralNotAvailableException
Writes shorts starting at the given index in the raw memory area associated with this object. This method transfers shorts 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.

Parameters:
index - the byte index in the raw memory area at which the shorts will be written.
src - the array from which shorts 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 shorts to be written to the given array; must be non-negative and no larger than src.length - offset.
Throws:
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

Copyright (c) 1990, 2012, Oracle and/or its affiliates. All rights reserved.