com.jinke.io
Class RandomAccessFile

java.lang.Object
  extended by com.jinke.io.RandomAccessFile
All Implemented Interfaces:
java.io.DataInput, java.io.DataOutput

public class RandomAccessFile
extends java.lang.Object
implements java.io.DataOutput, java.io.DataInput


Field Summary
private  short fd
           
private static int O_RDONLY
           
private static int O_RDWR
           
private static int O_SYNC
           
 
Constructor Summary
RandomAccessFile(java.lang.String s, java.lang.String s1)
           
 
Method Summary
 void close()
           
 void close(int i)
           
 long getFilePointer()
           
 long getFilePointer(int i)
           
 long length()
           
 long length(int i)
           
static void main(java.lang.String[] args)
           
private  void open(byte[] abyte0, int i)
           
 int read()
           
 int read(byte[] abyte0)
           
 int read(byte[] abyte0, int i, int j)
           
 int read(short word0)
           
 boolean readBoolean()
           
 byte readByte()
           
 int readBytes(byte[] abyte0, int i, int j)
           
 int readBytes(short word0, byte[] abyte0, int i, int j)
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] abyte0)
           
 void readFully(byte[] abyte0, int i, int j)
           
 int readInt()
           
 java.lang.String readLine()
           
 long readLong()
           
 short readShort()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 java.lang.String readUTF()
           
 void seek(int i, long l)
           
 void seek(long l)
           
 int skipBytes(int i)
           
 void write(byte[] abyte0)
           
 void write(byte[] abyte0, int i, int j)
           
 void write(int i)
           
 void write(short word0, int i)
           
 void writeBoolean(boolean flag)
           
 void writeByte(int i)
           
 void writeBytes(byte[] abyte0, int i, int j)
           
 void writeBytes(short word0, byte[] abyte0, int i, int j)
           
 void writeBytes(java.lang.String s)
           
 void writeChar(int i)
           
 void writeChars(java.lang.String s)
           
 void writeDouble(double d)
           
 void writeFloat(float f)
           
 void writeInt(int i)
           
 void writeLong(long l)
           
 void writeShort(int i)
           
 void writeUTF(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fd

private short fd

O_RDONLY

private static final int O_RDONLY
See Also:
Constant Field Values

O_RDWR

private static final int O_RDWR
See Also:
Constant Field Values

O_SYNC

private static final int O_SYNC
See Also:
Constant Field Values
Constructor Detail

RandomAccessFile

public RandomAccessFile(java.lang.String s,
                        java.lang.String s1)
                 throws FileNotFoundException,
                        java.io.IOException
Parameters:
s -
s1 -
Throws:
FileNotFoundException
java.io.IOException
Method Detail

open

private void open(byte[] abyte0,
                  int i)
           throws FileNotFoundException
Throws:
FileNotFoundException

close

public void close(int i)
Parameters:
i -

getFilePointer

public long getFilePointer(int i)
Parameters:
i -
Returns:

length

public long length(int i)
Parameters:
i -
Returns:

seek

public void seek(int i,
                 long l)
Parameters:
i -
l -

read

public int read(short word0)
         throws java.io.IOException
Parameters:
word0 -
Returns:
Throws:
java.io.IOException

readBytes

public int readBytes(short word0,
                     byte[] abyte0,
                     int i,
                     int j)
              throws java.io.IOException
Parameters:
word0 -
abyte0 -
i -
j -
Returns:
Throws:
java.io.IOException

write

public void write(short word0,
                  int i)
           throws java.io.IOException
Parameters:
word0 -
i -
Throws:
java.io.IOException

writeBytes

public void writeBytes(short word0,
                       byte[] abyte0,
                       int i,
                       int j)
                throws java.io.IOException
Parameters:
word0 -
abyte0 -
i -
j -
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

getFilePointer

public long getFilePointer()
                    throws java.io.IOException
Returns:
Throws:
java.io.IOException

length

public long length()
            throws java.io.IOException
Returns:
Throws:
java.io.IOException

seek

public void seek(long l)
          throws java.io.IOException
Parameters:
l -
Throws:
java.io.IOException

skipBytes

public int skipBytes(int i)
              throws java.io.IOException
Specified by:
skipBytes in interface java.io.DataInput
Parameters:
i -
Returns:
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Returns:
Throws:
java.io.IOException

readBytes

public int readBytes(byte[] abyte0,
                     int i,
                     int j)
              throws java.io.IOException
Parameters:
abyte0 -
i -
j -
Returns:
Throws:
java.io.IOException

read

public int read(byte[] abyte0,
                int i,
                int j)
         throws java.io.IOException
Parameters:
abyte0 -
i -
j -
Returns:
Throws:
java.io.IOException

read

public int read(byte[] abyte0)
         throws java.io.IOException
Parameters:
abyte0 -
Returns:
Throws:
java.io.IOException

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Specified by:
readBoolean in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readByte

public byte readByte()
              throws java.io.IOException
Specified by:
readByte in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readChar

public char readChar()
              throws java.io.IOException
Specified by:
readChar in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readDouble

public double readDouble()
                  throws java.io.IOException
Specified by:
readDouble in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readFloat

public float readFloat()
                throws java.io.IOException
Specified by:
readFloat in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readFully

public void readFully(byte[] abyte0)
               throws java.io.IOException
Specified by:
readFully in interface java.io.DataInput
Parameters:
abyte0 -
Throws:
java.io.IOException

readFully

public void readFully(byte[] abyte0,
                      int i,
                      int j)
               throws java.io.IOException
Specified by:
readFully in interface java.io.DataInput
Parameters:
abyte0 -
i -
j -
Throws:
java.io.IOException

readInt

public int readInt()
            throws java.io.IOException
Specified by:
readInt in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readLong

public long readLong()
              throws java.io.IOException
Specified by:
readLong in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readShort

public short readShort()
                throws java.io.IOException
Specified by:
readShort in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readUnsignedByte

public int readUnsignedByte()
                     throws java.io.IOException
Specified by:
readUnsignedByte in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readUnsignedShort

public int readUnsignedShort()
                      throws java.io.IOException
Specified by:
readUnsignedShort in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Returns:
Throws:
java.io.IOException

readUTF

public java.lang.String readUTF()
                         throws java.io.IOException
Specified by:
readUTF in interface java.io.DataInput
Returns:
Throws:
java.io.IOException

write

public void write(int i)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Parameters:
i -
Throws:
java.io.IOException

writeBytes

public void writeBytes(byte[] abyte0,
                       int i,
                       int j)
                throws java.io.IOException
Parameters:
abyte0 -
i -
j -
Throws:
java.io.IOException

write

public void write(byte[] abyte0,
                  int i,
                  int j)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Parameters:
abyte0 -
i -
j -
Throws:
java.io.IOException

writeBoolean

public void writeBoolean(boolean flag)
                  throws java.io.IOException
Specified by:
writeBoolean in interface java.io.DataOutput
Parameters:
flag -
Throws:
java.io.IOException

writeByte

public void writeByte(int i)
               throws java.io.IOException
Specified by:
writeByte in interface java.io.DataOutput
Parameters:
i -
Throws:
java.io.IOException

write

public void write(byte[] abyte0)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Parameters:
abyte0 -
Throws:
java.io.IOException

writeBytes

public void writeBytes(java.lang.String s)
                throws java.io.IOException
Parameters:
s -
Throws:
java.io.IOException

writeChar

public void writeChar(int i)
               throws java.io.IOException
Specified by:
writeChar in interface java.io.DataOutput
Parameters:
i -
Throws:
java.io.IOException

writeChars

public void writeChars(java.lang.String s)
                throws java.io.IOException
Specified by:
writeChars in interface java.io.DataOutput
Parameters:
s -
Throws:
java.io.IOException

writeDouble

public void writeDouble(double d)
                 throws java.io.IOException
Specified by:
writeDouble in interface java.io.DataOutput
Parameters:
d -
Throws:
java.io.IOException

writeFloat

public void writeFloat(float f)
                throws java.io.IOException
Specified by:
writeFloat in interface java.io.DataOutput
Parameters:
f -
Throws:
java.io.IOException

writeInt

public void writeInt(int i)
              throws java.io.IOException
Specified by:
writeInt in interface java.io.DataOutput
Parameters:
i -
Throws:
java.io.IOException

writeLong

public void writeLong(long l)
               throws java.io.IOException
Specified by:
writeLong in interface java.io.DataOutput
Parameters:
l -
Throws:
java.io.IOException

writeShort

public void writeShort(int i)
                throws java.io.IOException
Specified by:
writeShort in interface java.io.DataOutput
Parameters:
i -
Throws:
java.io.IOException

writeUTF

public void writeUTF(java.lang.String s)
              throws java.io.IOException
Specified by:
writeUTF in interface java.io.DataOutput
Parameters:
s -
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Parameters:
args -