JML

java.io
Class RandomAccessFile

java.lang.Object
  extended byjava.io.RandomAccessFile
All Implemented Interfaces:
DataInput, DataOutput

public class RandomAccessFile
extends Object
implements DataOutput, DataInput


Model Field Summary
 
Model fields inherited from class java.lang.Object
_getClass, objectState, theString
 
Model fields inherited from interface java.io.DataInput
bytesRead, input
 
Ghost Field Summary
 
Ghost fields inherited from class java.lang.Object
objectTimesFinalized, owner
 
Field Summary
private  FileChannel channel
           
private  FileDescriptor fd
           
private static int O_DSYNC
           
private static int O_RDONLY
           
private static int O_RDWR
           
private static int O_SYNC
           
private  boolean rw
           
 
Constructor Summary
RandomAccessFile(File, String)
           
RandomAccessFile(String, String)
           
 
Model Method Summary
 
Model methods inherited from class java.lang.Object
hashValue
 
Method Summary
 void close()
           
private  void close0()
           
 FileChannel getChannel()
           
 FileDescriptor getFD()
           
 long getFilePointer()
           
private static void initIDs()
           
 long length()
           
private  void open(String, int)
           
 int read()
           
 int read(byte[])
           
 int read(byte[], int, int)
           
 boolean readBoolean()
           
 byte readByte()
           
private  int readBytes(byte[], int, int)
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[])
           
 void readFully(byte[], int, int)
           
 int readInt()
           
 String readLine()
           
 long readLong()
           
 short readShort()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 String readUTF()
           
 void seek(long)
           
 void setLength(long)
           
 int skipBytes(int)
           
 void write(byte[])
           
 void write(byte[], int, int)
           
 void write(int)
           
 void writeBoolean(boolean)
           
 void writeByte(int)
           
private  void writeBytes(byte[], int, int)
           
 void writeBytes(String)
           
 void writeChar(int)
           
 void writeChars(String)
           
 void writeDouble(double)
           
 void writeFloat(float)
           
 void writeInt(int)
           
 void writeLong(long)
           
 void writeShort(int)
           
 void writeUTF(String)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

O_RDWR

private static final int O_RDWR

O_RDONLY

private static final int O_RDONLY

fd

private FileDescriptor fd

channel

private FileChannel channel

O_DSYNC

private static final int O_DSYNC

O_SYNC

private static final int O_SYNC

rw

private boolean rw
Constructor Detail

RandomAccessFile

public RandomAccessFile(File,
                        String)
                 throws FileNotFoundException
Throws:
FileNotFoundException

RandomAccessFile

public RandomAccessFile(String,
                        String)
                 throws FileNotFoundException
Throws:
FileNotFoundException
Method Detail

readByte

public final byte readByte()
                    throws IOException
Specified by:
readByte in interface DataInput
Throws:
IOException

readChar

public final char readChar()
                    throws IOException
Specified by:
readChar in interface DataInput
Throws:
IOException

readDouble

public final double readDouble()
                        throws IOException
Specified by:
readDouble in interface DataInput
Throws:
IOException

readFloat

public final float readFloat()
                      throws IOException
Specified by:
readFloat in interface DataInput
Throws:
IOException

read

public int read()
         throws IOException
Throws:
IOException

readInt

public final int readInt()
                  throws IOException
Specified by:
readInt in interface DataInput
Throws:
IOException

readUnsignedByte

public final int readUnsignedByte()
                           throws IOException
Specified by:
readUnsignedByte in interface DataInput
Throws:
IOException

readUnsignedShort

public final int readUnsignedShort()
                            throws IOException
Specified by:
readUnsignedShort in interface DataInput
Throws:
IOException

getFilePointer

public long getFilePointer()
                    throws IOException
Throws:
IOException

length

public long length()
            throws IOException
Throws:
IOException

readLong

public final long readLong()
                    throws IOException
Specified by:
readLong in interface DataInput
Throws:
IOException

readShort

public final short readShort()
                      throws IOException
Specified by:
readShort in interface DataInput
Throws:
IOException

close

public void close()
           throws IOException
Throws:
IOException

close0

private void close0()
             throws IOException
Throws:
IOException

initIDs

private static void initIDs()

readBoolean

public final boolean readBoolean()
                          throws IOException
Specified by:
readBoolean in interface DataInput
Throws:
IOException

writeDouble

public final void writeDouble(double)
                       throws IOException
Specified by:
writeDouble in interface DataOutput
Throws:
IOException

writeFloat

public final void writeFloat(float)
                      throws IOException
Specified by:
writeFloat in interface DataOutput
Throws:
IOException

skipBytes

public int skipBytes(int)
              throws IOException
Specified by:
skipBytes in interface DataInput
Throws:
IOException

write

public void write(int)
           throws IOException
Specified by:
write in interface DataOutput
Throws:
IOException

writeByte

public final void writeByte(int)
                     throws IOException
Specified by:
writeByte in interface DataOutput
Throws:
IOException

writeChar

public final void writeChar(int)
                     throws IOException
Specified by:
writeChar in interface DataOutput
Throws:
IOException

writeInt

public final void writeInt(int)
                    throws IOException
Specified by:
writeInt in interface DataOutput
Throws:
IOException

writeShort

public final void writeShort(int)
                      throws IOException
Specified by:
writeShort in interface DataOutput
Throws:
IOException

seek

public void seek(long)
          throws IOException
Throws:
IOException

setLength

public void setLength(long)
               throws IOException
Throws:
IOException

writeLong

public final void writeLong(long)
                     throws IOException
Specified by:
writeLong in interface DataOutput
Throws:
IOException

writeBoolean

public final void writeBoolean(boolean)
                        throws IOException
Specified by:
writeBoolean in interface DataOutput
Throws:
IOException

read

public int read(byte[])
         throws IOException
Throws:
IOException

readFully

public final void readFully(byte[])
                     throws IOException
Specified by:
readFully in interface DataInput
Throws:
IOException

write

public void write(byte[])
           throws IOException
Specified by:
write in interface DataOutput
Throws:
IOException

read

public int read(byte[],
                int,
                int)
         throws IOException
Throws:
IOException

readBytes

private int readBytes(byte[],
                      int,
                      int)
               throws IOException
Throws:
IOException

readFully

public final void readFully(byte[],
                            int,
                            int)
                     throws IOException
Specified by:
readFully in interface DataInput
Throws:
IOException

write

public void write(byte[],
                  int,
                  int)
           throws IOException
Specified by:
write in interface DataOutput
Throws:
IOException

writeBytes

private void writeBytes(byte[],
                        int,
                        int)
                 throws IOException
Throws:
IOException

getFD

public final FileDescriptor getFD()
                           throws IOException
Throws:
IOException

readLine

public final String readLine()
                      throws IOException
Specified by:
readLine in interface DataInput
Throws:
IOException

readUTF

public final String readUTF()
                     throws IOException
Specified by:
readUTF in interface DataInput
Throws:
IOException

writeBytes

public final void writeBytes(String)
                      throws IOException
Specified by:
writeBytes in interface DataOutput
Throws:
IOException

writeChars

public final void writeChars(String)
                      throws IOException
Specified by:
writeChars in interface DataOutput
Throws:
IOException

writeUTF

public final void writeUTF(String)
                    throws IOException
Specified by:
writeUTF in interface DataOutput
Throws:
IOException

open

private void open(String,
                  int)
           throws FileNotFoundException
Throws:
FileNotFoundException

getChannel

public final FileChannel getChannel()

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.