org.walluck.io
Class LittleEndianOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
org.walluck.io.DataOutputStreamEx
org.walluck.io.LittleEndianOutputStream
- All Implemented Interfaces:
- Closeable, DataOutput, Flushable
- Direct Known Subclasses:
- AIMOutputStream
public class LittleEndianOutputStream
- extends DataOutputStreamEx
An output stream that supports little endian byte order to the limited
degree nedded to support ICQ.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- David Walluck
- See Also:
DataOutputStreamEx
Method Summary |
void |
writeIntLE(int n)
Write an integer to this stream in little endian byte order. |
void |
writeShortLE(int n)
Write a short to this stream in little endian byte order. |
void |
writeStringLLLE0(String s)
Write a string to this stream prefixed by its length, a short in little
endian byte order, terminated by a null. |
Methods inherited from class java.io.DataOutputStream |
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LittleEndianOutputStream
public LittleEndianOutputStream(OutputStream os)
- Creates a new little endian output stream.
- Parameters:
os
- the underlying output stream
writeIntLE
public void writeIntLE(int n)
throws IOException
- Write an integer to this stream in little endian byte order.
- Parameters:
n
- the integer to write
- Throws:
IOException
- if an error occurs
writeShortLE
public void writeShortLE(int n)
throws IOException
- Write a short to this stream in little endian byte order.
- Parameters:
n
- the short to write
- Throws:
IOException
- if an error occurs
writeStringLLLE0
public void writeStringLLLE0(String s)
throws IOException
- Write a string to this stream prefixed by its length, a short in little
endian byte order, terminated by a null.
- Parameters:
s
- the string to write
- Throws:
IOException
- if an error occurs