22.23
java.io.RandomAccessFile
THE PACKAGE JAVA.IO
22.23.6
public long length() throws IOException
The length of this random access file, measured in bytes, is returned.
An
IOException
is thrown if the length cannot be read for any reason.
22.23.7
public void close() throws IOException
This random access file is closed. A closed random access file cannot perform
input or output operations and cannot be reopened.
22.23.8
public int read() throws IOException
This method reads one byte from the random access file. The byte is returned as
an integer in the range 0 to 255 (
0x00
0xff
). If no byte is available because the
file pointer is at end of file, the value
1
is returned.
If the byte cannot be read for any reason other than end of file, an
IOExcep
tion
is thrown. In particular, an
IOException
is thrown if the input stream has
been closed ( 22.23.7).
Although
RandomAccessFile
is not a subclass of
InputStream
, this method
behaves in exactly the same way as the
read
method of
InputStream
( 22.3.1).
22.23.9
public int read(byte[] b)
throws IOException, NullPointerException
Although
RandomAccessFile
is not a subclass of
InputStream
, this method
behaves in exactly the same way as the
read
method of
InputStream
( 22.3.2).
22.23.10
public int read(byte[] b, int off, int len)
throws IOException, NullPointerException,
IndexOutOfBoundsException
Although
RandomAccessFile
is not a subclass of
InputStream
, this method
behaves in exactly the same way as the
read
method of
InputStream
( 22.3.3).
22.23.11
public final void readFully(byte[] b)
throws IOException, NullPointerException
See the general contract of the
readFully
method of
DataInput
( 22.1.1).
746
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved