ucar.unidata.io
Class PositioningDataInputStream

java.lang.Object
  extended by ucar.unidata.io.PositioningDataInputStream

public class PositioningDataInputStream
extends java.lang.Object

Similar to a DataInputStream that keeps track of position. position must always increase, no going backwards. cant handle byte order yet - assume big endian(?).

Since:
Jan 3, 2008
Author:
caron

Constructor Summary
PositioningDataInputStream(java.io.InputStream is)
           
 
Method Summary
 void read(long pos, byte[] dest, int off, int len)
           
 void readDouble(long pos, double[] dest, int off, int len)
           
 void readFloat(long pos, float[] dest, int off, int len)
           
 void readInt(long pos, int[] dest, int off, int len)
           
 void readLong(long pos, long[] dest, int off, int len)
           
 void readShort(long pos, short[] dest, int off, int len)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositioningDataInputStream

public PositioningDataInputStream(java.io.InputStream is)
Method Detail

read

public void read(long pos,
                 byte[] dest,
                 int off,
                 int len)
          throws java.io.IOException
Throws:
java.io.IOException

readShort

public void readShort(long pos,
                      short[] dest,
                      int off,
                      int len)
               throws java.io.IOException
Throws:
java.io.IOException

readInt

public void readInt(long pos,
                    int[] dest,
                    int off,
                    int len)
             throws java.io.IOException
Throws:
java.io.IOException

readLong

public void readLong(long pos,
                     long[] dest,
                     int off,
                     int len)
              throws java.io.IOException
Throws:
java.io.IOException

readFloat

public void readFloat(long pos,
                      float[] dest,
                      int off,
                      int len)
               throws java.io.IOException
Throws:
java.io.IOException

readDouble

public void readDouble(long pos,
                       double[] dest,
                       int off,
                       int len)
                throws java.io.IOException
Throws:
java.io.IOException