DataOutput for writing to in-memory byte arrays; its methods offer
identical functionality but do not throw IOException.
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | |
| public void | write(int
the byte to be written. b)Redeclares java. b.
|
| public void | write(byte[]
the data. b)Redeclares java. b.
|
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Redeclares java. len bytes from array
b, in order, to
the output stream.
|
| public void | writeBoolean(boolean
the boolean to be written. v)Redeclares java. boolean value to this output stream.
|
| public void | writeByte(int
the byte value to be written. v)Redeclares java. v.
|
| public void | writeBytes(String
the string of bytes to be written. s)Redeclares java.
Deprecated
This method is dangerous as it discards the high byte of every character. For
UTF-8, use
Writes a string to the output stream.
write(s.getBytes(StandardCharsets.UTF_8)).
|
| public void | writeChar(int
the v)char value to be written.Redeclares java. char value, which
is comprised of two bytes, to the
output stream.
|
| public void | writeChars(String
the string value to be written. s)Redeclares java. s,
to the output stream, in order,
two bytes per character.
|
| public void | writeDouble(double
the v)double value to be written.Redeclares java. double value,
which is comprised of eight bytes, to the output stream.
|
| public void | writeFloat(float
the v)float value to be written.Redeclares java. float value,
which is comprised of four bytes, to the output stream.
|
| public void | writeInt(int
the v)int value to be written.Redeclares java. int value, which is
comprised of four bytes, to the output stream.
|
| public void | writeLong(long
the v)long value to be written.Redeclares java. long value, which is
comprised of eight bytes, to the output stream.
|
| public void | writeShort(int
the v)short value to be written.Redeclares java. |
| public void | writeUTF(String
the string value to be written. s)Redeclares java. s.
|
| toByteArray | back to summary |
|---|---|
| public byte[] toByteArray() Returns the contents that have been written to this instance, as a byte array. | |
| write | back to summary |
|---|---|
| public void write(int b) Redeclares java. Doc from java. Writes to the output stream the eight
low-order bits of the argument
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) Redeclares java. Doc from java. Writes to the output stream all the bytes in array
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) Redeclares java. Doc from java. Writes
| |
| writeBoolean | back to summary |
|---|---|
| public void writeBoolean(boolean v) Redeclares java. Doc from java. Writes a
| |
| writeByte | back to summary |
|---|---|
| public void writeByte(int v) Redeclares 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) Redeclares java. Doc from java. Deprecated This method is dangerous as it discards the high byte of every character. For
UTF-8, use Writes a string to the output stream.
For every character in the string
If
| |
| writeChar | back to summary |
|---|---|
| public void writeChar(int v) Redeclares java. Doc from java. Writes a
The bytes written by this method may be
read by the
| |
| writeChars | back to summary |
|---|---|
| public void writeChars(String s) Redeclares java. Doc from java. Writes every character in the string | |
| writeDouble | back to summary |
|---|---|
| public void writeDouble(double v) Redeclares java. Doc from java. Writes a
| |
| writeFloat | back to summary |
|---|---|
| public void writeFloat(float v) Redeclares java. Doc from java. Writes a
| |
| writeInt | back to summary |
|---|---|
| public void writeInt(int v) Redeclares java. Doc from java. Writes an
The bytes written by this method may be read
by the
| |
| writeLong | back to summary |
|---|---|
| public void writeLong(long v) Redeclares java. Doc from java. Writes a
The bytes written by this method may be
read by the
| |
| writeShort | back to summary |
|---|---|
| public void writeShort(int v) Redeclares java. Doc from java. Writes two bytes to the output stream to represent the value of the argument. The byte values to be written, in the order shown, are:
The bytes written by this method may be
read by the
| |
| writeUTF | back to summary |
|---|---|
| public void writeUTF(String s) Redeclares 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 | |