Android APIs
Added in API level 1
public interface

DataOutput

java.io.DataOutput
Known Indirect Subclasses

Class Overview

Defines an interface for classes that are able to write big-endian typed data to some target. Typically, this data can be read in by a class which implements DataInput. 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 MUTF-8 encoded strings.

Summary

Public Methods
abstract void write(int oneByte)
Writes the specified 8-bit byte.
abstract void write(byte[] buffer, int offset, int count)
Writes count bytes from the byte array buffer starting at offset index.
abstract void write(byte[] buffer)
Writes the entire contents of the byte array buffer to this stream.
abstract void writeBoolean(boolean val)
Writes the specified boolean.
abstract void writeByte(int val)
Writes the specified 8-bit byte.
abstract void writeBytes(String str)
Writes the low order 8-bit bytes from the specified string.
abstract void writeChar(int val)
Writes the specified 16-bit character in big-endian order.
abstract void writeChars(String str)
Writes the 16-bit characters contained in str in big-endian order.
abstract void writeDouble(double val)
Writes the specified 64-bit double in big-endian order.
abstract void writeFloat(float val)
Writes the specified 32-bit float in big-endian order.
abstract void writeInt(int val)
Writes the specified 32-bit int in big-endian order.
abstract void writeLong(long val)
Writes the specified 64-bit long in big-endian order.
abstract void writeShort(int val)
Writes the specified 16-bit short in big-endian order.
abstract void writeUTF(String str)
Writes the specified string encoded in modified UTF-8.

Public Methods

public abstract void write (int oneByte)

Added in API level 1

Writes the specified 8-bit byte.

Parameters
oneByte int: the byte to write.
Throws
IOException if an I/O error occurs while writing.

See also:

public abstract void write (byte[] buffer, int offset, int count)

Added in API level 1

Writes count bytes from the byte array buffer starting at offset index.

Parameters
buffer byte: the buffer to write.
offset int: the index of the first byte in buffer to write.
count int: the number of bytes from the buffer to write.
Throws
IOException if an I/O error occurs while writing.

public abstract void write (byte[] buffer)

Added in API level 1

Writes the entire contents of the byte array buffer to this stream.

Parameters
buffer byte: the buffer to write.
Throws
IOException if an I/O error occurs while writing.

public abstract void writeBoolean (boolean val)

Added in API level 1

Writes the specified boolean.

Parameters
val boolean: the boolean value to write.
Throws
IOException if an I/O error occurs while writing.

See also:

public abstract void writeByte (int val)

Added in API level 1

Writes the specified 8-bit byte.

Parameters
val int: the byte value to write.
Throws
IOException if an I/O error occurs while writing.

public abstract void writeBytes (String str)

Added in API level 1

Writes the low order 8-bit bytes from the specified string.

Parameters
str String: the string containing the bytes to write.
Throws
IOException if an I/O error occurs while writing.

public abstract void writeChar (int val)

Added in API level 1

Writes the specified 16-bit character in big-endian order. Only the two least significant bytes of the integer oneByte are written.

Parameters
val int: the character to write.
Throws
IOException if an I/O error occurs while writing.

See also:

public abstract void writeChars (String str)

Added in API level 1

Writes the 16-bit characters contained in str in big-endian order.

Parameters
str String: the string that contains the characters to write.
Throws
IOException if an I/O error occurs while writing.

See also:

public abstract void writeDouble (double val)

Added in API level 1

Writes the specified 64-bit double in big-endian order. The resulting output is the eight bytes returned by doubleToLongBits(double).

Parameters
val double: the double to write.
Throws
IOException if an I/O error occurs while writing.

See also:

public abstract void writeFloat (float val)

Added in API level 1

Writes the specified 32-bit float in big-endian order. The resulting output is the four bytes returned by floatToIntBits(float).

Parameters
val float: the float to write.
Throws
IOException if an I/O error occurs while writing.

See also:

public abstract void writeInt (int val)

Added in API level 1

Writes the specified 32-bit int in big-endian order.

Parameters
val int: the int to write.
Throws
IOException if an I/O error occurs while writing.

See also:

public abstract void writeLong (long val)

Added in API level 1

Writes the specified 64-bit long in big-endian order.

Parameters
val long: the long to write.
Throws
IOException if an I/O error occurs while writing.

See also:

public abstract void writeShort (int val)

Added in API level 1

Writes the specified 16-bit short in big-endian order. Only the lower two bytes of val are written.

Parameters
val int: the short to write.
Throws
IOException if an I/O error occurs while writing.

public abstract void writeUTF (String str)

Added in API level 1

Writes the specified string encoded in modified UTF-8.

Parameters
str String: the string to write encoded in modified UTF-8.
Throws
IOException if an I/O error occurs while writing.

See also: