lcm.util
Class BufferedRandomAccessFile

java.lang.Object
  extended by lcm.util.BufferedRandomAccessFile

public class BufferedRandomAccessFile
extends java.lang.Object


Field Summary
static boolean check
           
 
Constructor Summary
BufferedRandomAccessFile(java.io.File file, java.lang.String mode)
          Invariant: the current file position = bufferOffset + bufferPosition.
BufferedRandomAccessFile(java.lang.String path, java.lang.String mode)
           
 
Method Summary
 void close()
           
 void flush()
           
 long getFilePointer()
           
 boolean hasMore()
           
 long length()
           
static void main(java.lang.String[] args)
           
 byte peek()
           
 int read()
           
 boolean readBoolean()
           
 byte readByte()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] b)
           
 void readFully(byte[] b, int offset, int length)
           
 int readInt()
           
 java.lang.String readLine()
           
 java.lang.String readLineCheck()
           
 long readLong()
           
 short readShort()
           
 java.lang.String readUTF()
           
 void seek(long pos)
           
 void write(byte v)
           
 void write(byte[] src, int offset, int writelen)
           
 void write(int v)
           
 void writeBoolean(boolean b)
           
 void writeDouble(double f)
           
 void writeFloat(float f)
           
 void writeInt(long v)
           
 void writeLong(long v)
           
 void writeShort(short v)
           
 void writeUTF(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

check

public static boolean check
Constructor Detail

BufferedRandomAccessFile

public BufferedRandomAccessFile(java.io.File file,
                                java.lang.String mode)
                         throws java.io.IOException
Invariant: the current file position = bufferOffset + bufferPosition. This position is always stored inside the buffer, or this position is the byte after the current buffer (in which case the next read will re-fill the buffer.

Throws:
java.io.IOException

BufferedRandomAccessFile

public BufferedRandomAccessFile(java.lang.String path,
                                java.lang.String mode)
                         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

close

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

getFilePointer

public long getFilePointer()

length

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

seek

public void seek(long pos)
          throws java.io.IOException
Throws:
java.io.IOException

flush

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

read

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

hasMore

public boolean hasMore()
                throws java.io.IOException
Throws:
java.io.IOException

peek

public byte peek()
          throws java.io.IOException
Throws:
java.io.IOException

write

public void write(int v)
           throws java.io.IOException
Throws:
java.io.IOException

writeBoolean

public void writeBoolean(boolean b)
                  throws java.io.IOException
Throws:
java.io.IOException

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Throws:
java.io.IOException

writeShort

public void writeShort(short v)
                throws java.io.IOException
Throws:
java.io.IOException

readByte

public byte readByte()
              throws java.io.IOException
Throws:
java.io.IOException

readShort

public short readShort()
                throws java.io.IOException
Throws:
java.io.IOException

readFully

public void readFully(byte[] b,
                      int offset,
                      int length)
               throws java.io.IOException
Throws:
java.io.IOException

readFully

public void readFully(byte[] b)
               throws java.io.IOException
Throws:
java.io.IOException

writeInt

public void writeInt(long v)
              throws java.io.IOException
Throws:
java.io.IOException

readInt

public int readInt()
            throws java.io.IOException
Throws:
java.io.IOException

writeLong

public void writeLong(long v)
               throws java.io.IOException
Throws:
java.io.IOException

readLong

public long readLong()
              throws java.io.IOException
Throws:
java.io.IOException

writeFloat

public void writeFloat(float f)
                throws java.io.IOException
Throws:
java.io.IOException

readFloat

public float readFloat()
                throws java.io.IOException
Throws:
java.io.IOException

writeDouble

public void writeDouble(double f)
                 throws java.io.IOException
Throws:
java.io.IOException

readDouble

public double readDouble()
                  throws java.io.IOException
Throws:
java.io.IOException

writeUTF

public void writeUTF(java.lang.String s)
              throws java.io.IOException
Throws:
java.io.IOException

readUTF

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

write

public void write(byte[] src,
                  int offset,
                  int writelen)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte v)
           throws java.io.IOException
Throws:
java.io.IOException

readLineCheck

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

readLine

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

main

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