| java.lang.Object | |||
| ↳ | java.io.OutputStream | ||
| ↳ | java.io.FilterOutputStream | ||
| ↳ | java.io.DataOutputStream | ||
DataOutputStream is a filter class which can write typed data to a Stream. Typically, this stream can be read in by a DataInputStream. Types that can be written include byte, 16-bit short, 32-bit int, 32-bit float, 64-bit long, 64-bit double, byte strings, and UTF Strings.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| written | The number of bytes written out so far | ||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.FilterOutputStream
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new DataOutputStream on the OutputStream
out. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Flush this DataOutputStream to ensure all pending data is sent out to the
target OutputStream.
| |||||||||||
Returns the total number of bytes written to this stream thus far.
| |||||||||||
Writes the specified
byte to the OutputStream. | |||||||||||
Writes
count bytes from the byte array
buffer starting at offset index to the
OutputStream. | |||||||||||
Writes a boolean to this output stream.
| |||||||||||
Writes a 8-bit byte to this output stream.
| |||||||||||
Writes the low order 8-bit bytes from a String to this output stream.
| |||||||||||
Writes the specified 16-bit character to the OutputStream.
| |||||||||||
Writes the specified 16-bit characters contained in str to the
OutputStream.
| |||||||||||
Writes a 64-bit double to this output stream.
| |||||||||||
Writes a 32-bit float to this output stream.
| |||||||||||
Writes a 32-bit int to this output stream.
| |||||||||||
Writes a 64-bit long to this output stream.
| |||||||||||
Writes the specified 16-bit short to the OutputStream.
| |||||||||||
Writes the specified String out in UTF format.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.io.FilterOutputStream
| |||||||||||
From class java.io.OutputStream
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface java.io.Closeable
| |||||||||||
From interface java.io.DataOutput
| |||||||||||
From interface java.io.Flushable
| |||||||||||
The number of bytes written out so far
Constructs a new DataOutputStream on the OutputStream out.
All writes can now be filtered through this stream. Note that data
written by this Stream is not in a human readable format but can be
reconstructed by using a DataInputStream on the resulting output.
| out | the target OutputStream to filter writes on. |
|---|
Flush this DataOutputStream to ensure all pending data is sent out to the target OutputStream. This implementation flushes the target OutputStream.
| IOException | If an error occurs attempting to flush this DataOutputStream. |
|---|
Returns the total number of bytes written to this stream thus far.
Writes the specified byte to the OutputStream.
| oneByte | the byte to be written |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes count bytes from the byte array
buffer starting at offset index to the
OutputStream.
| buffer | the buffer to be written |
|---|---|
| offset | offset in buffer to get bytes |
| count | number of bytes in buffer to write |
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes a boolean to this output stream.
| val | the boolean value to write to the OutputStream |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes a 8-bit byte to this output stream.
| val | the byte value to write to the OutputStream |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes the low order 8-bit bytes from a String to this output stream.
| str | the String containing the bytes to write to the OutputStream |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes the specified 16-bit character to the OutputStream. Only the lower 2 bytes are written with the higher of the 2 bytes written first. This represents the Unicode value of val.
| val | the character to be written |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes the specified 16-bit characters contained in str to the OutputStream. Only the lower 2 bytes of each character are written with the higher of the 2 bytes written first. This represents the Unicode value of each character in str.
| str | the String whose characters are to be written. |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes a 64-bit double to this output stream. The resulting output is the 8 bytes resulting from calling Double.doubleToLongBits().
| val | the double to be written. |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes a 32-bit float to this output stream. The resulting output is the 4 bytes resulting from calling Float.floatToIntBits().
| val | the float to be written. |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes a 32-bit int to this output stream. The resulting output is the 4 bytes, highest order first, of val.
| val | the int to be written. |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes a 64-bit long to this output stream. The resulting output is the 8 bytes, highest order first, of val.
| val | the long to be written. |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes the specified 16-bit short to the OutputStream. Only the lower 2 bytes are written with the higher of the 2 bytes written first.
| val | the short to be written |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|
Writes the specified String out in UTF format.
| str | the String to be written in UTF format. |
|---|
| IOException | If an error occurs attempting to write to this DataOutputStream. |
|---|