DataOutput that uses little-endian byte ordering for writing char, short, int, float, double, and long values.Note
This class intentionally violates the specification of its supertype DataOutput, which explicitly requires big-endian byte order.
| Access | Constructor and Description |
|---|---|
| public | LittleEndianDataOutputStream(OutputStream
the stream to delegate to out)Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Implements java. len bytes from array
b, in order, to
the output stream.
|
| public void | writeBoolean(boolean
the boolean to be written. v)Implements java. boolean value to this output stream.
|
| public void | writeByte(int
the byte value to be written. v)Implements java. v.
|
| public void | writeBytes(String
the string of bytes to be written. s)Implements java.
Deprecated
The semantics of
Writes a string to the output stream.
writeBytes(String s) are considered dangerous.
|
| public void | writeChar(int
the v)char value to be written.Implements java. DataOutputStream#writeChar(int), except using
little-endian byte order.
|
| public void | writeChars(String
the string value to be written. s)Implements java. String as specified by DataOutputStream#writeChars(String), except
each character is written using little-endian byte order.
|
| public void | writeDouble(double
the v)double value to be written.Implements java. double as specified by DataOutputStream#writeDouble(double), except
using little-endian byte order.
|
| public void | writeFloat(float
the v)float value to be written.Implements java. float as specified by DataOutputStream#writeFloat(float), except using
little-endian byte order.
|
| public void | writeInt(int
the v)int value to be written.Implements java. int as specified by DataOutputStream#writeInt(int), except using
little-endian byte order.
|
| public void | writeLong(long
the v)long value to be written.Implements java. long as specified by DataOutputStream#writeLong(long), except using
little-endian byte order.
|
| public void | writeShort(int
the v)short value to be written.Implements java. short as specified by DataOutputStream#writeShort(int), except using
little-endian byte order.
|
| public void | writeUTF(String
the string value to be written. str)Implements java. s.
|
| LittleEndianDataOutputStream | back to summary |
|---|---|
| public LittleEndianDataOutputStream(OutputStream out) Creates a
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources associated with the stream.
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Implements java. Doc from java. Writes
| |
| writeBoolean | back to summary |
|---|---|
| public void writeBoolean(boolean v) throws IOException Implements java. Doc from java. Writes a
| |
| writeByte | back to summary |
|---|---|
| public void writeByte(int v) throws IOException Implements java. Doc from java. Writes to the output stream the eight low-order
bits of the argument
| |
| writeBytes | back to summary |
|---|---|
| public void writeBytes(String s) throws IOException Implements java. Doc from java. Deprecated The semantics of Writes a string to the output stream.
For every character in the string
If
| |
| writeChar | back to summary |
|---|---|
| public void writeChar(int v) throws IOException Implements java. Writes a char as specified by
| |
| writeChars | back to summary |
|---|---|
| public void writeChars(String s) throws IOException Implements java. Writes a
| |
| writeDouble | back to summary |
|---|---|
| public void writeDouble(double v) throws IOException Implements java. Writes a
| |
| writeFloat | back to summary |
|---|---|
| public void writeFloat(float v) throws IOException Implements java. Writes a
| |
| writeInt | back to summary |
|---|---|
| public void writeInt(int v) throws IOException Implements java. Writes an
| |
| writeLong | back to summary |
|---|---|
| public void writeLong(long v) throws IOException Implements java. Writes a
| |
| writeShort | back to summary |
|---|---|
| public void writeShort(int v) throws IOException Implements java. Writes a
| |
| writeUTF | back to summary |
|---|---|
| public void writeUTF(String str) throws IOException Implements java. Doc from java. Writes two bytes of length information
to the output stream, followed
by the
modified UTF-8
representation
of every character in the string
If a character (byte)c
If a character If a character
First,
the total number of bytes needed to represent
all the characters of The
bytes written by this method may be read
by the
| |