Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.imagero.uio
Class RandomAccessByteArrayRO  view RandomAccessByteArrayRO download RandomAccessByteArrayRO.java

java.lang.Object
  extended bycom.imagero.uio.AbstractRandomAccessRO
      extended bycom.imagero.uio.RandomAccessByteArrayRO
All Implemented Interfaces:
java.io.DataInput, Input, RandomAccessRO

public class RandomAccessByteArrayRO
extends AbstractRandomAccessRO

Makes possible to access byte array as RandomAccessRO


Nested Class Summary
 
Nested classes inherited from class com.imagero.uio.AbstractRandomAccessRO
AbstractRandomAccessRO.DataInputBE, AbstractRandomAccessRO.DataInputLE
 
Field Summary
(package private)  byte[] buf
           
(package private)  int fp
           
(package private)  int length
           
(package private)  int offset
           
 
Fields inherited from class com.imagero.uio.AbstractRandomAccessRO
byteOrder, dataInput
 
Fields inherited from interface com.imagero.uio.RandomAccessRO
BIG_ENDIAN, LITTLE_ENDIAN
 
Constructor Summary
RandomAccessByteArrayRO(byte[] data, int byteOrder)
          create new RandomAccessByteArray
RandomAccessByteArrayRO(byte[] data, int off, int length, int byteOrder)
          create new RandomAccessByteArray
 
Method Summary
protected  int _read()
           
 void close()
          does nothing
 long getFilePointer()
          Since this is an interface and is not restricted to files, "getFilePointer" is wrong name for this method.
protected  int getOffset()
           
 long length()
          Returns the length of this byte array.
 int read()
          Reads a byte of data from this byte array.
 int read(byte[] b)
           
 int read(byte[] b, int off, int length)
           
 void seek(long pos)
          Sets the array-pointer offset, measured from the beginning of this byte array, at which the next read or write occurs.
protected  void setOffset(int offset)
           
 int skip(int n)
           
 
Methods inherited from class com.imagero.uio.AbstractRandomAccessRO
_setByteOrder, getByteOrder, readBoolean, readByte, readByteLine, readByteOrder, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setByteOrder, skipBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fp

int fp

buf

byte[] buf

length

int length

offset

int offset
Constructor Detail

RandomAccessByteArrayRO

public RandomAccessByteArrayRO(byte[] data,
                               int byteOrder)
                        throws java.io.IOException
create new RandomAccessByteArray


RandomAccessByteArrayRO

public RandomAccessByteArrayRO(byte[] data,
                               int off,
                               int length,
                               int byteOrder)
                        throws java.io.IOException
create new RandomAccessByteArray

Method Detail

read

public int read()
Reads a byte of data from this byte array. The byte is returned as an integer in the range 0 to 255 (0x00-0x0ff).


_read

protected int _read()
             throws java.io.EOFException
Specified by:
_read in class AbstractRandomAccessRO

read

public int read(byte[] b)
         throws java.io.IOException

read

public int read(byte[] b,
                int off,
                int length)
         throws java.io.IOException

close

public void close()
does nothing


getOffset

protected int getOffset()

setOffset

protected void setOffset(int offset)

skip

public int skip(int n)
         throws java.io.IOException

getFilePointer

public long getFilePointer()
                    throws java.io.IOException
Description copied from interface: RandomAccessRO
Since this is an interface and is not restricted to files, "getFilePointer" is wrong name for this method. But I leaved it so for easier porting from RandomAccessFile


seek

public void seek(long pos)
Sets the array-pointer offset, measured from the beginning of this byte array, at which the next read or write occurs. The offset may NOT be set beyond the end of the byte array.


length

public long length()
Returns the length of this byte array.