RandomAccessFile.read
Class Overview | Class Members |
This Package |
All Packages
public native int read() throws IOException
Returns
the next byte of data, or -1 if the end of the
file is reached.
Description
Reads a byte of data from this file. This method blocks if no
input is yet available.
Exceptions
IOException
if an I/O error occurs.
public int read( byte b[],
int off,
int len ) throws IOException
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 file has been reached.
Description
Reads up to len bytes of data from this file into an
array of bytes. This method blocks until at least one byte of input
is available.
Exceptions
IOException
if an I/O error occurs.
public int read( byte b[] ) throws IOException
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
this file has been reached.
Description
Reads up to b.length bytes of data from this file
into an array of bytes. This method blocks until at least one byte
of input is available.
Exceptions
IOException
if an I/O error occurs.