org.walluck.io
Class LittleEndianInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.DataInputStream
org.walluck.io.DataInputStreamEx
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
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 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.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LittleEndianInputStream
public LittleEndianInputStream(InputStream is)
- Creates a new little endian input stream.
- Parameters:
is
- the underlying input stream
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