org.jikesrvm.util
Class AddressInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.jikesrvm.util.AddressInputStream
All Implemented Interfaces:
Closeable

public final class AddressInputStream
extends InputStream

Access raw memory region as an input stream.


Field Summary
private  Offset length
          Length of the memory region
private  Address location
          Address of memory region to be read
private  Offset markOffset
          Mark offset
private  Offset offset
          Offset to be read
 
Constructor Summary
AddressInputStream(Address location, Offset length)
          Constructor
 
Method Summary
 int available()
           
 void mark(int readLimit)
          Mark location
 boolean markSupported()
          Is mark/reset supported
 int read()
          Read a byte
 void reset()
          Reset to mark
 long skip(long n)
          Skip bytes
 
Methods inherited from class java.io.InputStream
close, read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

location

private final Address location
Address of memory region to be read


length

private final Offset length
Length of the memory region


offset

private Offset offset
Offset to be read


markOffset

private Offset markOffset
Mark offset

Constructor Detail

AddressInputStream

public AddressInputStream(Address location,
                          Offset length)
Constructor

Method Detail

available

public int available()
Overrides:
available in class InputStream
Returns:
number of bytes that can be read

mark

public void mark(int readLimit)
Mark location

Overrides:
mark in class InputStream

markSupported

public boolean markSupported()
Is mark/reset supported

Overrides:
markSupported in class InputStream

read

public int read()
         throws IOException
Read a byte

Specified by:
read in class InputStream
Throws:
IOException

reset

public void reset()
Reset to mark

Overrides:
reset in class InputStream

skip

public long skip(long n)
Skip bytes

Overrides:
skip in class InputStream