com.imagero.uio
Class BaisWrapper

java.lang.Object
  extended byjava.io.InputStream
      extended bycom.imagero.uio.impl.AbstractRandomAccessInput
          extended bycom.imagero.uio.BaisWrapper
All Implemented Interfaces:
AdvancedDataInput, java.io.DataInput, Input, ISeekable, RandomAccessInput

public class BaisWrapper
extends AbstractRandomAccessInput

Wrapper for ByteArrayInputStream which gives possibility to use it as AbstractRandomAccessInput. Date: 19.12.2007


Field Summary
 
Fields inherited from class com.imagero.uio.impl.AbstractRandomAccessInput
byteOrder
 
Fields inherited from interface com.imagero.uio.ISeekable
BIG_ENDIAN, LITTLE_ENDIAN
 
Constructor Summary
BaisWrapper(BaisWrapper in, long offset, int byteOrder)
           
BaisWrapper(java.io.ByteArrayInputStream in)
           
 
Method Summary
 void close()
           
 RandomAccessInput createInputChild(long offset, int byteOrder, boolean syncPointer)
           
 java.io.InputStream createInputStream(long offset)
           
 long getFilePointer()
          Since this is an interface and is not restricted to files, "getFilePointer" is wrong name for this method.
 long length()
          get length of data
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 void seek(long position)
          set current cursor position to specified offset
 long skip(long n)
           
 
Methods inherited from class com.imagero.uio.impl.AbstractRandomAccessInput
getByteOrder, isBuffered, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, readBoolean, readByte, readByteLine, readByteLine, readChar, readChar, readDouble, readDouble, readFloat, 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, readInt, readLine, readLong, readLong, readShort, readShort, readUnsignedByte, readUnsignedShort, readUnsignedShort, readUTF, setByteOrder, skipBytes
 
Methods inherited from class java.io.InputStream
available
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaisWrapper

public BaisWrapper(java.io.ByteArrayInputStream in)

BaisWrapper

public BaisWrapper(BaisWrapper in,
                   long offset,
                   int byteOrder)
Method Detail

read

public int read()
         throws java.io.IOException
Throws:
java.io.IOException

read

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

skip

public long skip(long n)
          throws java.io.IOException
Throws:
java.io.IOException

seek

public void seek(long position)
          throws java.io.IOException
Description copied from interface: ISeekable
set current cursor position to specified offset

Parameters:
position - new cursor position
Throws:
java.io.IOException

markSupported

public boolean markSupported()

mark

public void mark(int readlimit)

reset

public void reset()
           throws java.io.IOException
Throws:
java.io.IOException

getFilePointer

public long getFilePointer()
Description copied from interface: ISeekable
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

Returns:
current cursor position

length

public long length()
Description copied from interface: ISeekable
get length of data

Returns:
data length (in bytes)

createInputChild

public RandomAccessInput createInputChild(long offset,
                                          int byteOrder,
                                          boolean syncPointer)
                                   throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

createInputStream

public java.io.InputStream createInputStream(long offset)