All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class org.jos.java.io.RandomAccessFile

java.lang.Object
    |
    +----org.jos.java.io.RandomAccessFile

public class RandomAccessFile
extends Object
implements DataInput, DataOutput
JOS replacement of a standard Java IO class.

based on kore-0.0.7 by Glynn Clements

Sun really didn't include a "truncate" method in RandomAccessFile!?!? How do you shorten a 500MB file, then? By copying? Hmgrm.

Version:
JOS-FileSystem 4 Preview (25-Mar-98)
Author:
Glynn Clements
Author:
Stefan Reich

Constructor Index

 o RandomAccessFile(File, String)
 o RandomAccessFile(String, String)

Method Index

 o close()
 o getFD()
 o getFilePointer()
 o length()
 o read()
 o read(byte[])
 o read(byte[], int, int)
 o readBoolean()
 o readByte()
 o readChar()
 o readDouble()
 o readFloat()
 o readFully(byte[])
 o readFully(byte[], int, int)
 o readInt()
 o readLine()
 o readLong()
 o readShort()
 o readUnsignedByte()
 o readUnsignedShort()
 o readUTF()
 o seek(long)
 o skipBytes(int)
skip n bytes in the file, if possible.
 o write(byte[])
 o write(byte[], int, int)
 o write(int)
 o writeBoolean(boolean)
 o writeByte(int)
 o writeBytes(String)
 o writeChar(int)
 o writeChars(String)
 o writeDouble(double)
 o writeFloat(float)
 o writeInt(int)
 o writeLong(long)
 o writeShort(int)
 o writeUTF(String)

Constructors

 o RandomAccessFile
public RandomAccessFile(String path,
                        String mode) throws IOException
 o RandomAccessFile
public RandomAccessFile(File file,
                        String mode) throws IOException

Methods

 o getFD
public final FileDescriptor getFD() throws IOException
 o close
public void close() throws IOException
 o getFilePointer
public long getFilePointer() throws IOException
 o seek
public void seek(long pos) throws IOException
 o length
public long length() throws IOException
 o skipBytes
public int skipBytes(int n) throws IOException
skip n bytes in the file, if possible.

Parameters:
n - the number of bytes to skip.
Returns:
the number of bytes actually skipped.
 o read
public int read() throws IOException
 o read
public int read(byte[] b) throws IOException
 o read
public int read(byte[] b,
                int off,
                int len) throws IOException
 o write
public void write(int c) throws IOException
 o write
public void write(byte[] b) throws IOException
 o write
public void write(byte[] b,
                  int off,
                  int len) throws IOException
 o readBoolean
public final boolean readBoolean() throws IOException
 o readByte
public final byte readByte() throws IOException
 o readUnsignedByte
public final int readUnsignedByte() throws IOException
 o readChar
public final char readChar() throws IOException
 o readShort
public final short readShort() throws IOException
 o readUnsignedShort
public final int readUnsignedShort() throws IOException
 o readInt
public final int readInt() throws IOException
 o readLong
public final long readLong() throws IOException
 o readFloat
public final float readFloat() throws IOException
 o readDouble
public final double readDouble() throws IOException
 o readLine
public final String readLine() throws IOException
 o readUTF
public final String readUTF() throws IOException
 o readFully
public final void readFully(byte[] b) throws IOException
 o readFully
public final void readFully(byte[] b,
                            int off,
                            int len) throws IOException
 o writeBoolean
public final void writeBoolean(boolean v) throws IOException
 o writeByte
public final void writeByte(int v) throws IOException
 o writeChar
public final void writeChar(int v) throws IOException
 o writeShort
public final void writeShort(int v) throws IOException
 o writeInt
public final void writeInt(int v) throws IOException
 o writeLong
public final void writeLong(long v) throws IOException
 o writeFloat
public final void writeFloat(float v) throws IOException
 o writeDouble
public final void writeDouble(double v) throws IOException
 o writeBytes
public final void writeBytes(String s) throws IOException
 o writeChars
public final void writeChars(String s) throws IOException
 o writeUTF
public final void writeUTF(String s) throws IOException

All Packages  Class Hierarchy  This Package  Previous  Next  Index