public interface RawBlock extends RawMemory
RawBlock
interface provides methods to access a continuous range of physical memory (raw memory) as a
ByteBuffer
. A RawBlock
instance can be obtained from a MMIODevice
instance.
The index
parameter of ByteBuffer
absolute operations map to physical memory addresses. The
index
values are relative to the base address of the raw memory area. The index
value 0
corresponds to the base address of the raw memory area.Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
asDirectBuffer()
Gets the complete memory area this
RawBlock is mapped to as a direct ByteBuffer . |
java.lang.String |
getName()
Returns the name assigned to this
RawBlock instance. |
java.nio.ByteBuffer asDirectBuffer() throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
RawBlock
is mapped to as a direct ByteBuffer
. The
byte order of the retrieved buffer will be that of this device unless the byte ordering is not standard (as
indicated by the value Device.MIXED_ENDIAN
; in which case the buffer's byte order will be set to
ByteOrder.BIG_ENDIAN
.
When the returned ByteBuffer
instance is invalidated because the device is either closed or in
exclusive use by some other application then an attempt to access the ByteBuffer
instance will not change
the buffer's content and will cause a ClosedDeviceException
or some other unspecified exception to be
thrown either at the time of the access or at some later time.ByteBuffer
for the complete raw memory area associated with this
RawBlock
.java.io.IOException
- if some other I/O error occurs.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.java.lang.String getName()
RawBlock
instance.getName
in interface RawMemory
RawBlock
instance's name or null
if this RawBlock
instance was obtained by a
call to MMIODevice.getAsRawBlock
.Copyright © 2012, 2014, Oracle and/or its affiliates. All rights reserved.
Legal Notices