22.23
java.io.RandomAccessFile
THE PACKAGE JAVA.IO
public final long readLong() throws IOException;
public final float readFloat() throws IOException;
public final double readDouble() throws IOException;
public final String readLine() throws IOException;
public final String readUTF() throws IOException;
// The methods that implement interface DataOutput:
public native void write(int b) throws IOException;
public void write(byte[] b)
throws IOException, NullPointerException;
public void write(byte[] b, int off, int len)
throws IOException, NullPointerException,
IndexOutOfBoundsException;
public final void writeBoolean(boolean v) throws IOException;
public final void writeByte(int v) throws IOException;
public final void writeShort(int v) throws IOException;
public final void writeChar(int v) throws IOException;
public final void writeInt(int v) throws IOException;
public final void writeLong(long v) throws IOException;
public final void writeFloat(float v) throws IOException;
public final void writeDouble(double v) throws IOException;
public final void writeBytes(String s) throws IOException;
public final void writeChars(String s) throws IOException;
public final void writeUTF(String str) throws IOException;
}
It is generally true of all the reading routines in this class that if end of file is
reached before the desired number of bytes has been read, an
EOFException
(which is a kind of
IOException
) is thrown. If any byte cannot be read for any
reason other than end of file, an
IOException
other than
EOFException
is
thrown. In particular, an
IOException
may be thrown if the stream has been
closed ( 22.23.7).
22.23.1
public RandomAccessFile(String path, String mode)
throws SecurityException, IOException,
IllegalArgumentException
This constructor initializes a newly created
RandomAccessFile
by opening a
connection to an actual file, the file named by the path name
path
in the file sys
tem. A new
FileDescriptor
object is created to represent this file connection.
First, if there is a security manager, its
checkRead
method ( 20.17.19) is
called with the
path
argument as its argument.
Next, if
mode
is
"rw"
and there is a security manager, its
checkWrite
method
( 20.17.21) is called with the
path
argument as its argument.
744
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