DthingApi
Public Member Functions | List of all members
java.io.DataInput Interface Reference
Inheritance diagram for java.io.DataInput:
java.io.DataInputStream jp.co.cmcc.event.EventInputStream

Public Member Functions

abstract boolean readBoolean () throws IOException
 
abstract byte readByte () throws IOException
 
abstract char readChar () throws IOException
 
abstract double readDouble () throws IOException
 
abstract float readFloat () throws IOException
 
abstract void readFully (byte[] dst) throws IOException
 
abstract void readFully (byte[] dst, int offset, int byteCount) throws IOException
 
abstract int readInt () throws IOException
 
abstract long readLong () throws IOException
 
abstract short readShort () throws IOException
 
abstract int readUnsignedByte () throws IOException
 
abstract int readUnsignedShort () throws IOException
 
abstract String readUTF () throws IOException
 
abstract int skipBytes (int count) throws IOException
 

Detailed Description

Defines an interface for classes that are able to read big-endian typed data from some source. Typically, this data has been written by a class which implements DataOutput. Types that can be read include byte, 16-bit short, 32-bit int, 32-bit float, 64-bit long, 64-bit double, byte strings, and MUTF-8 strings.

MUTF-8 (Modified UTF-8) Encoding

When encoding strings as UTF, implementations of

DataInput

and

DataOutput

use a slightly modified form of UTF-8, hereafter referred to as MUTF-8. This form is identical to standard UTF-8, except:

Please refer to The Unicode Standard for further information about character encoding. MUTF-8 is actually closer to the (relatively less well-known) encoding CESU-8 than to UTF-8 per se.

See also
DataInputStream
RandomAccessFile

Member Function Documentation

◆ readBoolean()

abstract boolean java.io.DataInput.readBoolean ( ) throws IOException
abstract

Reads a boolean.

Returns
the next boolean value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeBoolean(boolean)

Implemented in java.io.DataInputStream.

◆ readByte()

abstract byte java.io.DataInput.readByte ( ) throws IOException
abstract

Reads an 8-bit byte value.

Returns
the next byte value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeByte(int)

Implemented in java.io.DataInputStream.

◆ readChar()

abstract char java.io.DataInput.readChar ( ) throws IOException
abstract

Reads a big-endian 16-bit character value.

Returns
the next char value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeChar(int)

Implemented in java.io.DataInputStream.

◆ readDouble()

abstract double java.io.DataInput.readDouble ( ) throws IOException
abstract

Reads a big-endian 64-bit double value.

Returns
the next double value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeDouble(double)

Implemented in java.io.DataInputStream.

◆ readFloat()

abstract float java.io.DataInput.readFloat ( ) throws IOException
abstract

Reads a big-endian 32-bit float value.

Returns
the next float value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeFloat(float)

Implemented in java.io.DataInputStream.

◆ readFully() [1/2]

abstract void java.io.DataInput.readFully ( byte []  dst) throws IOException
abstract

Equivalent to

readFully(dst, 0, dst.length);

.

Implemented in java.io.DataInputStream.

◆ readFully() [2/2]

abstract void java.io.DataInput.readFully ( byte []  dst,
int  offset,
int  byteCount 
) throws IOException
abstract

Reads

byteCount

bytes from this stream and stores them in the byte array

dst

starting at

offset

. If

byteCount

is zero, then this method returns without reading any bytes. Otherwise, this method blocks until

byteCount

bytes have been read. If insufficient bytes are available,

EOFException

is thrown. If an I/O error occurs,

IOException

is thrown. When an exception is thrown, some bytes may have been consumed from the stream and written into the array.

Parameters
dstthe byte array into which the data is read.
offsetthe offset in
dst
at which to store the bytes.
byteCountthe number of bytes to read.
Exceptions
EOFExceptionif the end of the source stream is reached before enough bytes have been read.
IndexOutOfBoundsExceptionif
offset < 0
or
byteCount < 0
, or
offset + byteCount > dst.length
.
IOExceptionif a problem occurs while reading from this stream.
NullPointerExceptionif
dst
is null.

Implemented in java.io.DataInputStream.

◆ readInt()

abstract int java.io.DataInput.readInt ( ) throws IOException
abstract

Reads a big-endian 32-bit integer value.

Returns
the next int value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeInt(int)

Implemented in java.io.DataInputStream.

◆ readLong()

abstract long java.io.DataInput.readLong ( ) throws IOException
abstract

Reads a big-endian 64-bit long value.

Returns
the next long value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeLong(long)

Implemented in java.io.DataInputStream.

◆ readShort()

abstract short java.io.DataInput.readShort ( ) throws IOException
abstract

Reads a big-endian 16-bit short value.

Returns
the next short value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeShort(int)

Implemented in java.io.DataInputStream.

◆ readUnsignedByte()

abstract int java.io.DataInput.readUnsignedByte ( ) throws IOException
abstract

Reads an unsigned 8-bit byte value and returns it as an int.

Returns
the next unsigned byte value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeByte(int)

Implemented in java.io.DataInputStream.

◆ readUnsignedShort()

abstract int java.io.DataInput.readUnsignedShort ( ) throws IOException
abstract

Reads a big-endian 16-bit unsigned short value and returns it as an int.

Returns
the next unsigned short value.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeShort(int)

Implemented in java.io.DataInputStream.

◆ readUTF()

abstract String java.io.DataInput.readUTF ( ) throws IOException
abstract

Reads a string encoded with modified UTF-8.

Returns
the next string encoded with modified UTF-8.
Exceptions
EOFExceptionif the end of the input is reached before the read request can be satisfied.
IOExceptionif an I/O error occurs while reading.
See also
DataOutput::writeUTF(java.lang.String)

Implemented in java.io.DataInputStream.

◆ skipBytes()

abstract int java.io.DataInput.skipBytes ( int  count) throws IOException
abstract

Skips

count

number of bytes. This method will not throw an EOFException if the end of the input is reached before

count

bytes where skipped.

Parameters
countthe number of bytes to skip.
Returns
the number of bytes actually skipped.
Exceptions
IOExceptionif a problem occurs during skipping.

Implemented in java.io.DataInputStream.


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