com.imagero.uio
Class AbstractRandomAccess

java.lang.Object
  extended bycom.imagero.uio.AbstractRandomAccessRO
      extended bycom.imagero.uio.AbstractRandomAccess
All Implemented Interfaces:
java.io.DataInput, java.io.DataOutput, Input, RandomAccess, RandomAccessRO
Direct Known Subclasses:
RandomAccessBuffer, RandomAccessByteArray, RandomAccessFileWrapper

public abstract class AbstractRandomAccess
extends AbstractRandomAccessRO
implements RandomAccess

implementation of RandomAccess


Field Summary
 
Fields inherited from interface com.imagero.uio.RandomAccessRO
BIG_ENDIAN, LITTLE_ENDIAN
 
Constructor Summary
AbstractRandomAccess()
           
 
Method Summary
protected  void _setByteOrder(int byteOrder)
          not all images are tiffs, so we don't throw exception if called from constructor
 void setByteOrder(int byteOrder)
          set byte order
 void write(char[] sh)
          Writes char array to the output
 void write(char[] sh, int byteOrder)
          Writes char array to the output
 void write(char[] sh, int offset, int length)
          Writes char array to the output
 void write(char[] sh, int offset, int length, int byteOrder)
          Writes char array to the output
 void write(double[] source)
          Writes double array to the output
 void write(double[] source, int byteOrder)
          Writes double array to the output
 void write(double[] source, int offset, int length)
          Writes double array to the output
 void write(double[] source, int offset, int length, int byteOrder)
          Writes double array to the output
 void write(float[] source)
          Writes float array to the output
 void write(float[] source, int byteOrder)
          Writes float array to the output
 void write(float[] source, int offset, int length)
          Writes int array to the output
 void write(float[] source, int offset, int length, int byteOrder)
          Writes float array to the output
 void write(int[] source)
          Writes int array to the output
 void write(int[] source, int byteOrder)
          Writes int array to the output
 void write(int[] source, int offset, int length)
          Writes int array to the output
 void write(int[] source, int offset, int length, int byteOrder)
          Writes int array to the output
 void write(long[] source)
          Writes long array to the output
 void write(long[] source, int byteOrder)
          Writes long array to the output
 void write(long[] source, int offset, int length)
          Writes long array to the output
 void write(long[] source, int offset, int length, int byteOrder)
          Writes long array to the output
 void write(short[] sh)
          Writes short array to the output
 void write(short[] sh, int byteOrder)
          Writes short array to the output
 void write(short[] sh, int offset, int length)
          Writes short array to the output
 void write(short[] sh, int offset, int length, int byteOrder)
          Writes short array to the output
 void writeBoolean(boolean b)
           
 void writeByte(int b)
           
 void writeBytes(java.lang.String s)
           
 void writeChar(int v)
           
 void writeChars(java.lang.String s)
           
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int v)
           
 void writeLong(long v)
           
 void writeShort(int v)
           
 void writeUTF(java.lang.String str)
           
 
Methods inherited from class com.imagero.uio.AbstractRandomAccessRO
_read, 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, skipBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.imagero.uio.RandomAccess
setLength
 
Methods inherited from interface com.imagero.uio.RandomAccessRO
getByteOrder, getFilePointer, length, readByteLine, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, seek
 
Methods inherited from interface com.imagero.uio.Input
close, read, read, read, skip
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 
Methods inherited from interface java.io.DataOutput
write, write, write
 

Constructor Detail

AbstractRandomAccess

public AbstractRandomAccess()
Method Detail

writeBoolean

public void writeBoolean(boolean b)
                  throws java.io.IOException
Specified by:
writeBoolean in interface java.io.DataOutput
Throws:
java.io.IOException

writeByte

public void writeByte(int b)
               throws java.io.IOException
Specified by:
writeByte in interface java.io.DataOutput
Throws:
java.io.IOException

write

public void write(short[] sh)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes short array to the output

Specified by:
write in interface RandomAccess
Parameters:
sh - short array
Throws:
java.io.IOException

write

public void write(short[] sh,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes short array to the output

Specified by:
write in interface RandomAccess
Parameters:
sh - short array
byteOrder - byte order in which short array read into temporary buffer
Throws:
java.io.IOException

write

public void write(short[] sh,
                  int offset,
                  int length)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes short array to the output

Specified by:
write in interface RandomAccess
Parameters:
sh - short array
offset - start offset in array
length - length number of shorts to write
Throws:
java.io.IOException

write

public void write(short[] sh,
                  int offset,
                  int length,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes short array to the output

Specified by:
write in interface RandomAccess
Parameters:
sh - short array
offset - start offset in array
length - length number of shorts to write
byteOrder - byte order in which short array read into temporary buffer
Throws:
java.io.IOException

write

public void write(char[] sh)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes char array to the output

Specified by:
write in interface RandomAccess
Parameters:
sh - char array
Throws:
java.io.IOException

write

public void write(char[] sh,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes char array to the output

Specified by:
write in interface RandomAccess
Parameters:
sh - char array
byteOrder - byte order in which char array read into temporary buffer
Throws:
java.io.IOException

write

public void write(char[] sh,
                  int offset,
                  int length)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes char array to the output

Specified by:
write in interface RandomAccess
Parameters:
sh - char array
offset - start offset in array
length - length number of shorts to write
Throws:
java.io.IOException

write

public void write(char[] sh,
                  int offset,
                  int length,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes char array to the output

Specified by:
write in interface RandomAccess
Parameters:
sh - char array
offset - start offset in array
length - length number of shorts to write
byteOrder - byte order in which char array read into temporary buffer
Throws:
java.io.IOException

write

public void write(int[] source)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes int array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - int array
Throws:
java.io.IOException

write

public void write(int[] source,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes int array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - int array
byteOrder - byte order in which int array read into temporary buffer
Throws:
java.io.IOException

write

public void write(int[] source,
                  int offset,
                  int length)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes int array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - int array
offset - start offset in array
length - length number of ints to write
Throws:
java.io.IOException

write

public void write(int[] source,
                  int offset,
                  int length,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes int array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - int array
offset - start offset in array
length - length number of ints to write
byteOrder - byte order in which int array read into temporary buffer
Throws:
java.io.IOException

write

public void write(float[] source)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes float array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - float array
Throws:
java.io.IOException

write

public void write(float[] source,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes float array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - float array
byteOrder - byte order in which float array read into temporary buffer
Throws:
java.io.IOException

write

public void write(float[] source,
                  int offset,
                  int length)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes int array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - int array
offset - start offset in array
length - length number of ints to write
Throws:
java.io.IOException

write

public void write(float[] source,
                  int offset,
                  int length,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes float array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - float array
offset - start offset in array
length - length number of float to write
byteOrder - byte order in which float array read into temporary buffer
Throws:
java.io.IOException

write

public void write(long[] source)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes long array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - long array
Throws:
java.io.IOException

write

public void write(long[] source,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes long array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - long array
byteOrder - byte order in which long array read into temporary buffer
Throws:
java.io.IOException

write

public void write(long[] source,
                  int offset,
                  int length)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes long array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - long array
offset - start offset in array
length - length number of longs to write
Throws:
java.io.IOException

write

public void write(long[] source,
                  int offset,
                  int length,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes long array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - long array
offset - start offset in array
length - length number of longs to write
byteOrder - byte order in which long array read into temporary buffer
Throws:
java.io.IOException

write

public void write(double[] source)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes double array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - double array
Throws:
java.io.IOException

write

public void write(double[] source,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes double array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - double array
byteOrder - byte order in which double array read into temporary buffer
Throws:
java.io.IOException

write

public void write(double[] source,
                  int offset,
                  int length)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes double array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - double array
offset - start offset in array
length - number of doubles to write
Throws:
java.io.IOException

write

public void write(double[] source,
                  int offset,
                  int length,
                  int byteOrder)
           throws java.io.IOException
Description copied from interface: RandomAccess
Writes double array to the output

Specified by:
write in interface RandomAccess
Parameters:
source - double array
offset - start offset in array
length - number of doubles to write
byteOrder - byte order in which long array read into temporary buffer
Throws:
java.io.IOException

writeFloat

public final void writeFloat(float v)
                      throws java.io.IOException
Specified by:
writeFloat in interface java.io.DataOutput
Throws:
java.io.IOException

writeDouble

public final void writeDouble(double v)
                       throws java.io.IOException
Specified by:
writeDouble in interface java.io.DataOutput
Throws:
java.io.IOException

writeBytes

public void writeBytes(java.lang.String s)
                throws java.io.IOException
Specified by:
writeBytes in interface java.io.DataOutput
Throws:
java.io.IOException

writeChars

public void writeChars(java.lang.String s)
                throws java.io.IOException
Specified by:
writeChars in interface java.io.DataOutput
Throws:
java.io.IOException

writeUTF

public void writeUTF(java.lang.String str)
              throws java.io.IOException
Specified by:
writeUTF in interface java.io.DataOutput
Throws:
java.io.IOException

writeShort

public void writeShort(int v)
                throws java.io.IOException
Specified by:
writeShort in interface java.io.DataOutput
Throws:
java.io.IOException

writeChar

public void writeChar(int v)
               throws java.io.IOException
Specified by:
writeChar in interface java.io.DataOutput
Throws:
java.io.IOException

writeInt

public void writeInt(int v)
              throws java.io.IOException
Specified by:
writeInt in interface java.io.DataOutput
Throws:
java.io.IOException

writeLong

public void writeLong(long v)
               throws java.io.IOException
Specified by:
writeLong in interface java.io.DataOutput
Throws:
java.io.IOException

setByteOrder

public void setByteOrder(int byteOrder)
                  throws java.io.IOException
Description copied from interface: RandomAccessRO
set byte order

Specified by:
setByteOrder in interface RandomAccessRO
Overrides:
setByteOrder in class AbstractRandomAccessRO
Throws:
java.io.IOException

_setByteOrder

protected void _setByteOrder(int byteOrder)
                      throws java.io.IOException
not all images are tiffs, so we don't throw exception if called from constructor

Overrides:
_setByteOrder in class AbstractRandomAccessRO
Parameters:
byteOrder -
Throws:
java.io.IOException