DataOutputStream

public class DataOutputStream
extends FilterOutputStream implements DataOutput

java.lang.Object
   ↳ java.io.OutputStream
     ↳ java.io.FilterOutputStream
       ↳ java.io.DataOutputStream


A data output stream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in.

See also:

Summary

Fields

protected int written

The number of bytes written to the data output stream so far.

Inherited fields

Public constructors

DataOutputStream(OutputStream out)

Creates a new data output stream to write data to the specified underlying output stream.

Public methods

void flush()

Flushes this data output stream.

final int size()

Returns the current value of the counter written, the number of bytes written to this data output stream so far.

void write(byte[] b, int off, int len)

Writes len bytes from the specified byte array starting at offset off to the underlying output stream.

void write(int b)

Writes the specified byte (the low eight bits of the argument b) to the underlying output stream.

final void writeBoolean(boolean v)

Writes a boolean to the underlying output stream as a 1-byte value.

final void writeByte(int v)

Writes out a byte to the underlying output stream as a 1-byte value.

final void writeBytes(String s)

Writes out the string to the underlying output stream as a sequence of bytes.

final void writeChar(int v)

Writes a char to the underlying output stream as a 2-byte value, high byte first.

final void writeChars(String s)

Writes a string to the underlying output stream as a sequence of characters.

final void writeDouble(double v)

Converts the double argument to a