FreeHEP API
Version v1.2

org.freehep.util.io
Class ByteOrderInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.freehep.util.io.DecompressableInputStream
              |
              +--org.freehep.util.io.BitInputStream
                    |
                    +--org.freehep.util.io.ByteOrderInputStream
All Implemented Interfaces:
DataInput
Direct Known Subclasses:
ByteCountInputStream

public class ByteOrderInputStream
extends BitInputStream
implements DataInput

Class to read bytes and pairs of bytes in both little and big endian order.

Version:
$Id: ByteOrderInputStream.java,v 1.3 2003/04/15 18:03:06 duns Exp $
Author:
Mark Donszelmann, Charles Loomis

Field Summary
protected  boolean little
           
 
Fields inherited from class org.freehep.util.io.BitInputStream
BIT_MASK, FIELD_MASK, MASK_SIZE, ONES, ZERO
 
Constructor Summary
ByteOrderInputStream(InputStream in)
           
ByteOrderInputStream(InputStream in, boolean littleEndian)
           
 
Method Summary
 String readAsciiZString()
           
 boolean readBoolean()
           
 byte readByte()
          Read a signed byte.
 byte[] readByte(int n)
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] b)
           
 void readFully(byte[] b, int off, int len)
           
 int readInt()
          Read a signed integer.
 int[] readInt(int n)
           
 String readLine()
          Deprecated.  
 long readLong()
           
 short readShort()
          Read a signed short.
 short[] readShort(int n)
           
 String readString()
           
 int readUnsignedByte()
          Read an unsigned byte.
 int[] readUnsignedByte(int n)
           
 long readUnsignedInt()
          Read an unsigned integer.
 long[] readUnsignedInt(int n)
           
 int readUnsignedShort()
          Read an unsigned short.
 int[] readUnsignedShort(int n)
           
 String readUTF()
           
 int skipBytes(int n)
           
 
Methods inherited from class org.freehep.util.io.BitInputStream
byteAlign, fetchByte, readBitFlag, readFBits, readSBits, readUBits
 
Methods inherited from class org.freehep.util.io.DecompressableInputStream
read, skip, startDecompressing
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

little

protected boolean little
Constructor Detail

ByteOrderInputStream

public ByteOrderInputStream(InputStream in)

ByteOrderInputStream

public ByteOrderInputStream(InputStream in,
                            boolean littleEndian)
Method Detail

readFully

public void readFully(byte[] b)
               throws IOException
Specified by:
readFully in interface DataInput
IOException

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
               throws IOException
Specified by:
readFully in interface DataInput
IOException

skipBytes

public int skipBytes(int n)
              throws IOException
Specified by:
skipBytes in interface DataInput
IOException

readBoolean

public boolean readBoolean()
                    throws IOException
Specified by:
readBoolean in interface DataInput
IOException

readChar

public char readChar()
              throws IOException
Specified by:
readChar in interface DataInput
IOException

readByte

public byte readByte()
              throws IOException
Read a signed byte.

Specified by:
readByte in interface DataInput
IOException

readByte

public byte[] readByte(int n)
                throws IOException
IOException

readUnsignedByte

public int readUnsignedByte()
                     throws IOException
Read an unsigned byte.

Specified by:
readUnsignedByte in interface DataInput
IOException

readUnsignedByte

public int[] readUnsignedByte(int n)
                       throws IOException
IOException

readShort

public short readShort()
                throws IOException
Read a signed short.

Specified by:
readShort in interface DataInput
IOException

readShort

public short[] readShort(int n)
                  throws IOException
IOException

readUnsignedShort

public int readUnsignedShort()
                      throws IOException
Read an unsigned short.

Specified by:
readUnsignedShort in interface DataInput
IOException

readUnsignedShort

public int[] readUnsignedShort(int n)
                        throws IOException
IOException

readInt

public int readInt()
            throws IOException
Read a signed integer.

Specified by:
readInt in interface DataInput
IOException

readInt

public int[] readInt(int n)
              throws IOException
IOException

readUnsignedInt

public long readUnsignedInt()
                     throws IOException
Read an unsigned integer.

IOException

readUnsignedInt

public long[] readUnsignedInt(int n)
                       throws IOException
IOException

readLong

public long readLong()
              throws IOException
Specified by:
readLong in interface DataInput
IOException

readFloat

public float readFloat()
                throws IOException
Specified by:
readFloat in interface DataInput
IOException

readDouble

public double readDouble()
                  throws IOException
Specified by:
readDouble in interface DataInput
IOException

readLine

public String readLine()
                throws IOException
Deprecated.  

Specified by:
readLine in interface DataInput
IOException

readString

public String readString()
                  throws IOException
IOException

readUTF

public String readUTF()
               throws IOException
Specified by:
readUTF in interface DataInput
IOException

readAsciiZString

public String readAsciiZString()
                        throws IOException
IOException

FreeHEP API
Version v1.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.