DthingApi
Public Member Functions | List of all members
java.io.DataOutput Interface Reference
Inheritance diagram for java.io.DataOutput:
java.io.DataOutputStream

Public Member Functions

abstract void write (byte[] buffer) throws IOException
 
abstract void write (byte[] buffer, int offset, int count) throws IOException
 
abstract void write (int oneByte) throws IOException
 
abstract void writeBoolean (boolean val) throws IOException
 
abstract void writeByte (int val) throws IOException
 
abstract void writeBytes (String str) throws IOException
 
abstract void writeChar (int val) throws IOException
 
abstract void writeChars (String str) throws IOException
 
abstract void writeDouble (double val) throws IOException
 
abstract void writeFloat (float val) throws IOException
 
abstract void writeInt (int val) throws IOException
 
abstract void writeLong (long val) throws IOException
 
abstract void writeShort (int val) throws IOException
 
abstract void writeUTF (String str) throws IOException
 

Detailed Description

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.

See also
DataOutputStream
RandomAccessFile

Member Function Documentation

◆ write() [1/3]

abstract void java.io.DataOutput.write ( byte []  buffer) throws IOException
abstract

Writes the entire contents of the byte array

buffer

to this stream.

Parameters
bufferthe buffer to write.
Exceptions
IOExceptionif an I/O error occurs while writing.

◆ write() [2/3]

abstract void java.io.DataOutput.write ( byte []  buffer,
int  offset,
int  count 
) throws IOException
abstract

Writes

count

bytes from the byte array

buffer

starting at offset

index

.

Parameters
bufferthe buffer to write.
offsetthe index of the first byte in
buffer
to write.
countthe number of bytes from the
buffer
to write.
Exceptions
IOExceptionif an I/O error occurs while writing.

Implemented in java.io.DataOutputStream.

◆ write() [3/3]

abstract void java.io.DataOutput.write ( int  oneByte) throws IOException
abstract

Writes the specified 8-bit byte.

Parameters
oneBytethe byte to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readByte()

Implemented in java.io.DataOutputStream.

◆ writeBoolean()

abstract void java.io.DataOutput.writeBoolean ( boolean  val) throws IOException
abstract

Writes the specified boolean.

Parameters
valthe boolean value to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readBoolean()

Implemented in java.io.DataOutputStream.

◆ writeByte()

abstract void java.io.DataOutput.writeByte ( int  val) throws IOException
abstract

Writes the specified 8-bit byte.

Parameters
valthe byte value to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readByte()
DataInput::readUnsignedByte()

Implemented in java.io.DataOutputStream.

◆ writeBytes()

abstract void java.io.DataOutput.writeBytes ( String  str) throws IOException
abstract

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

Parameters
strthe string containing the bytes to write.
Exceptions
IOExceptionif an I/O error occurs while writing.

Implemented in java.io.DataOutputStream.

◆ writeChar()

abstract void java.io.DataOutput.writeChar ( int  val) throws IOException
abstract

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

oneByte

are written.

Parameters
valthe character to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readChar()

Implemented in java.io.DataOutputStream.

◆ writeChars()

abstract void java.io.DataOutput.writeChars ( String  str) throws IOException
abstract

Writes the 16-bit characters contained in

str

in big-endian order.

Parameters
strthe string that contains the characters to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readChar()

Implemented in java.io.DataOutputStream.

◆ writeDouble()

abstract void java.io.DataOutput.writeDouble ( double  val) throws IOException
abstract

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

Parameters
valthe double to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readDouble()

Implemented in java.io.DataOutputStream.

◆ writeFloat()

abstract void java.io.DataOutput.writeFloat ( float  val) throws IOException
abstract

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

Parameters
valthe float to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readFloat()

Implemented in java.io.DataOutputStream.

◆ writeInt()

abstract void java.io.DataOutput.writeInt ( int  val) throws IOException
abstract

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

Parameters
valthe int to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readInt()

Implemented in java.io.DataOutputStream.

◆ writeLong()

abstract void java.io.DataOutput.writeLong ( long  val) throws IOException
abstract

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

Parameters
valthe long to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readLong()

Implemented in java.io.DataOutputStream.

◆ writeShort()

abstract void java.io.DataOutput.writeShort ( int  val) throws IOException
abstract

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

val

are written.

Parameters
valthe short to write.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readShort()
DataInput::readUnsignedShort()

Implemented in java.io.DataOutputStream.

◆ writeUTF()

abstract void java.io.DataOutput.writeUTF ( String  str) throws IOException
abstract

Writes the specified string encoded in modified UTF-8.

Parameters
strthe string to write encoded in modified UTF-8.
Exceptions
IOExceptionif an I/O error occurs while writing.
See also
DataInput::readUTF()

Implemented in java.io.DataOutputStream.


The documentation for this interface was generated from the following file: