THE PACKAGE JAVA.IO
java.io.RandomAccessFile
22.23
If
mode
 is
"rw"
, then the file may be both read and written. If
mode
 is
"r"
,
then the file may be read but may not be written (every write method for this
object will simply throw an
IOException
). If
mode
 is not
"r"
 or
"rw"
, then this
constructor throws an
IllegalArgumentException
.
22.23.2
public RandomAccessFile(File file, 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
file
 in the file system. 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 represented by the
file
 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 represented by the
file
 argument as its argu 
ment.
If
mode
 is
"rw"
, then the file may be both read and written. If
mode
 is
"r"
,
then the file may be read but may not be written (every write method for this
object will simply throw an
IOException
). If
mode
 is not
"r"
 or
"rw"
, then this
constructor throws an
IllegalArgumentException
.
22.23.3
public final FileDescriptor getFD() throws IOException
This method returns the
FileDescriptor
 object ( 22.26) that represents the con 
nection to the actual file in the file system being used by this
RandomAccessFile
.
22.23.4
public long getFilePointer() throws IOException
The current file pointer for this random access file is returned. An
IOException
 is
thrown if the file pointer cannot be read for any reason.
22.23.5
public void seek(long pos) throws IOException
The file pointer for this random access file is set to
pos
, which is a position within
the file, measured in bytes. Position
0
 is the start of the file. An
IOException
 is
thrown if
pos
 is less than zero or greater than the length of the file, or if the file
pointer cannot be set for any other reason.
745






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java hosting

 

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