FreeHEP API
Version current

org.freehep.util.io
Class ByteOrderInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.freehep.util.io.DecompressableInputStream
          extended byorg.freehep.util.io.BitInputStream
              extended byorg.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
Source Code:
ByteOrderInputStream.java

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
Throws:
IOException

readFully

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

skipBytes

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

readBoolean

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

readChar

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

readByte

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

Specified by:
readByte in interface DataInput
Throws:
IOException

readByte

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

readUnsignedByte

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

Specified by:
readUnsignedByte in interface DataInput
Throws:
IOException

readUnsignedByte

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

readShort

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

Specified by:
readShort in interface DataInput
Throws:
IOException

readShort

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

readUnsignedShort

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

Specified by:
readUnsignedShort in interface DataInput
Throws:
IOException

readUnsignedShort

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

readInt

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

Specified by:
readInt in interface DataInput
Throws:
IOException

readInt

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

readUnsignedInt

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

Throws:
IOException

readUnsignedInt

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

readLong

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

readFloat

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

readDouble

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

readLine

public String readLine()
                throws IOException
Deprecated.  

Specified by:
readLine in interface DataInput
Throws:
IOException

readString

public String readString()
                  throws IOException
Throws:
IOException

readUTF

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

readAsciiZString

public String readAsciiZString()
                        throws IOException
Throws:
IOException

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.