org.walluck.io
Class LittleEndianInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
              extended by org.walluck.io.DataInputStreamEx
                  extended by org.walluck.io.LittleEndianInputStream
All Implemented Interfaces:
Closeable, DataInput
Direct Known Subclasses:
AIMInputStream

public class LittleEndianInputStream
extends DataInputStreamEx

An input stream that supports little endian byte order to the limited degree needed to support ICQ.

Since:
1.0
Version:
1.0
Author:
David Walluck
See Also:
DataInputStreamEx

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
LittleEndianInputStream(InputStream is)
          Creates a new little endian input stream.
 
Method Summary
 int readIntLE()
          Read an integer from this stream in little endian byte order.
 short readShortLE()
          Read a short from this stream in little endian byte order.
 String readStringLLLE()
          Read a string from this stream prefixed by its length, a short in little endian byte order.
 
Methods inherited from class org.walluck.io.DataInputStreamEx
readBytes, readString, readString0, readStringL, readStringLL, readStringNullPadded, readStringUntilNull
 
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LittleEndianInputStream

public LittleEndianInputStream(InputStream is)
Creates a new little endian input stream.

Parameters:
is - the underlying input stream
Method Detail

readIntLE

public int readIntLE()
              throws IOException
Read an integer from this stream in little endian byte order.

Returns:
the integer
Throws:
IOException - if an error occurs

readShortLE

public short readShortLE()
                  throws IOException
Read a short from this stream in little endian byte order.

Returns:
the short
Throws:
IOException - if an error occurs

readStringLLLE

public String readStringLLLE()
                      throws IOException
Read a string from this stream prefixed by its length, a short in little endian byte order. ICQ strings are null terminated, but that is already account for in the value of length.

Returns:
the string
Throws:
IOException - if an error occurs