Methods
read()Declaration:
public int read()
throws IOException
Description:
Reads the next byte of data from this input stream. The value byte is returned as an int in the range 0 to
255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This
method blocks until input data is available, the end of the stream is detected, or an exception is thrown.
This method simply performs in.read() and returns the result.
Overrides: read in class InputStream
Returns: the next byte of data, or -1 if the end of the stream is reached.
Throws:
IOException - if an I/O error occurs.
read(byte[])
Declaration:
public final int read(byte[] b)
throws IOException
Description:
See the general contract of the read method of DataInput.
Bytes for this operation are read from the contained input stream.
Overrides: read in class InputStream
Parameters:
b - the buffer into which the data is read.
Returns: the total number of bytes read into the buffer, or -1 if there is no more data because the end of
the stream has been reached.
Throws:
IOException - if an I/O error occurs.
See Also: InputStream.read(byte[], int, int)
read(byte[], int, int)
Declaration:
public final int read(byte[] b, int off, int len)
throws IOException
Description:
Reads up to len bytes of data from this input stream into an array of bytes. This method blocks until some
input is available.
This method simply performs in.read(b, off, len) and returns the result.
Overrides: read in class InputStream
Parameters:
b - the buffer into which the data is read.
off - the start offset of the data.
len - the maximum number of bytes read.
Returns: the total number of bytes read into the buffer, or -1 if there is no more data because the end of
the stream has been reached.
readFully(byte[])
22
Throws:
IOException - if an I/O error occurs.
readFully(byte[])
Declaration:
public final void readFully(byte[] b)
throws IOException
Description:
See the general contract of the readFully method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified By: readFully in interface DataInput
Parameters:
b - the buffer into which the data is read.
Throws:
EOFException - if this input stream reaches the end before reading all the bytes.
IOException - if an I/O error occurs.
readFully(byte[], int, int)
Declaration:
public final void readFully(byte[] b, int off, int len)
throws IOException
Description:
See the general contract of the readFully method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified By: readFully in interface DataInput
Parameters:
b - the buffer into which the data is read.
off - the start offset of the data.
len - the number of bytes to read.
Throws:
EOFException - if this input stream reaches the end before reading all the bytes.
IOException - if an I/O error occurs.
skipBytes(int)
Declaration:
public final int skipBytes(int n)
throws IOException
Description:
See the general contract of the skipBytes method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified By: skipBytes in interface DataInput
Parameters:
n - the number of bytes to be skipped.
Returns: the actual number of bytes skipped.
Throws:
IOException - if an I/O error occurs.
readBoolean()
Declaration:
public final boolean readBoolean()
throws IOException
Description:
See the general contract of the readBoolean method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified By: readBoolean in interface DataInput
Returns: the boolean value read.
Throws:
EOFException - if this input stream has reached the end.
IOException - if an I/O error occurs.
readByte()
Declaration:
public final byte readByte()
throws IOException
Description:
See the general contract of the readByte method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified By: readByte in interface DataInput
Returns: the next byte of this input stream as a signed 8-bit byte.
Throws:
EOFException - if this input stream has reached the end.
IOException - if an I/O error occurs.
readUnsignedByte()
Declaration:
public final int readUnsignedByte()
throws IOException
Description:
See the general contract of the readUnsignedByte method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified By: readUnsignedByte in interface DataInput
Returns: the next byte of this input stream, interpreted as an unsigned 8-bit number.
readShort()
24
Throws:
EOFException - if this input stream has reached the end.
IOException - if an I/O error occurs.
readShort()
Declaration:
public final short readShort()
throws IOException
Description:
See the general contract of the readShort method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified By: readShort in interface DataInput
Returns: the next two bytes of this input stream, interpreted as a signed 16-bit number.
Throws:
EOFException - if this input stream reaches the end before reading two bytes.
IOException - if an I/O error occurs.
readUnsignedShort()
Declaration:
public final int readUnsignedShort()
throws IOException
Description:
See the general contract of the readUnsignedShort method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified By: readUnsignedShort in interface DataInput
Returns: the next two bytes of this input stream, interpreted as an unsigned 16-bit integer.
Throws:
EOFException - if this input stream reaches the end before reading two bytes.
IOException - if an I/O error occurs.
readChar()
Declaration:
public final char readChar()
throws IOException
Description:
See the general contract of the readChar method of DataInput.
Bytes for this operation are read from the contained input stream.
Specified By: readChar in interface DataInput
Returns: the next two bytes of this input stream as a Unicode character.
Throws:
EOFException - if this input stream reaches the end before reading two bytes.
IOException - if an I/O error occurs.
No comments:
Post a Comment