org.apache.commons.io.input
Class SwappedDataInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.apache.commons.io.input.ProxyInputStream
              extended by org.apache.commons.io.input.SwappedDataInputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput

public class SwappedDataInputStream
extends ProxyInputStream
implements java.io.DataInput

DataInput for systems relying on little endian data formats. When read, values will be changed from little endian to big endian formats for internal usage.

Origin of code: Avalon Excalibur (IO)

Version:
CVS $Revision: 437567 $ $Date: 2006-08-28 08:39:07 +0200 (Mo, 28 Aug 2006) $
Author:
Peter Donald

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
SwappedDataInputStream(java.io.InputStream input)
          Constructs a SwappedDataInputStream.
 
Method Summary
 boolean readBoolean()
           
 byte readByte()
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] data)
           
 void readFully(byte[] data, int offset, int length)
           
 int readInt()
           
 java.lang.String readLine()
          Not currently supported.
 long readLong()
           
 short readShort()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 java.lang.String readUTF()
          Not currently supported.
 int skipBytes(int count)
           
 
Methods inherited from class org.apache.commons.io.input.ProxyInputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwappedDataInputStream

public SwappedDataInputStream(java.io.InputStream input)
Constructs a SwappedDataInputStream.

Parameters:
input - InputStream to read from
Method Detail

readBoolean

public boolean readBoolean()
                    throws java.io.IOException,
                           java.io.EOFException
Specified by:
readBoolean in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readBoolean()

readByte

public byte readByte()
              throws java.io.IOException,
                     java.io.EOFException
Specified by:
readByte in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readByte()

readChar

public char readChar()
              throws java.io.IOException,
                     java.io.EOFException
Specified by:
readChar in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readChar()

readDouble

public double readDouble()
                  throws java.io.IOException,
                         java.io.EOFException
Specified by:
readDouble in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readDouble()

readFloat

public float readFloat()
                throws java.io.IOException,
                       java.io.EOFException
Specified by:
readFloat in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readFloat()

readFully

public void readFully(byte[] data)
               throws java.io.IOException,
                      java.io.EOFException
Specified by:
readFully in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readFully(byte[])

readFully

public void readFully(byte[] data,
                      int offset,
                      int length)
               throws java.io.IOException,
                      java.io.EOFException
Specified by:
readFully in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readFully(byte[], int, int)

readInt

public int readInt()
            throws java.io.IOException,
                   java.io.EOFException
Specified by:
readInt in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readInt()

readLine

public java.lang.String readLine()
                          throws java.io.IOException,
                                 java.io.EOFException
Not currently supported.

Specified by:
readLine in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readLine()

readLong

public long readLong()
              throws java.io.IOException,
                     java.io.EOFException
Specified by:
readLong in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readLong()

readShort

public short readShort()
                throws java.io.IOException,
                       java.io.EOFException
Specified by:
readShort in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readShort()

readUnsignedByte

public int readUnsignedByte()
                     throws java.io.IOException,
                            java.io.EOFException
Specified by:
readUnsignedByte in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readUnsignedByte()

readUnsignedShort

public int readUnsignedShort()
                      throws java.io.IOException,
                             java.io.EOFException
Specified by:
readUnsignedShort in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readUnsignedShort()

readUTF

public java.lang.String readUTF()
                         throws java.io.IOException,
                                java.io.EOFException
Not currently supported.

Specified by:
readUTF in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.readUTF()

skipBytes

public int skipBytes(int count)
              throws java.io.IOException,
                     java.io.EOFException
Specified by:
skipBytes in interface java.io.DataInput
Throws:
java.io.IOException
java.io.EOFException
See Also:
DataInput.skipBytes(int)


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.