edu.swri.swiftvis.util
Class BufferedRandomAccessFile

java.lang.Object
  extended by java.io.RandomAccessFile
      extended by edu.swri.swiftvis.util.BufferedRandomAccessFile
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput, java.io.DataOutput

public class BufferedRandomAccessFile
extends java.io.RandomAccessFile


Field Summary
private  byte[] buffer
           
private  int curOffset
           
private static int DEFAULT_BUFFER_SIZE
           
private  int readToBuffer
           
 
Constructor Summary
BufferedRandomAccessFile(java.io.File f, java.lang.String mode)
           
BufferedRandomAccessFile(java.io.File f, java.lang.String mode, int bufSize)
           
BufferedRandomAccessFile(java.lang.String f, java.lang.String mode)
           
 
Method Summary
private  void fillBuffer()
           
 long getFilePointer()
           
static void main(java.lang.String[] args)
           
 int read()
           
 int read(byte[] buf)
           
 int read(byte[] buf, int offset, int len)
           
 void seek(long filePos)
           
 
Methods inherited from class java.io.RandomAccessFile
close, getChannel, getFD, length, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

private byte[] buffer

curOffset

private int curOffset

readToBuffer

private int readToBuffer

DEFAULT_BUFFER_SIZE

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

BufferedRandomAccessFile

public BufferedRandomAccessFile(java.io.File f,
                                java.lang.String mode)
                         throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

BufferedRandomAccessFile

public BufferedRandomAccessFile(java.lang.String f,
                                java.lang.String mode)
                         throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

BufferedRandomAccessFile

public BufferedRandomAccessFile(java.io.File f,
                                java.lang.String mode,
                                int bufSize)
                         throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException
Method Detail

main

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

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.RandomAccessFile
Throws:
java.io.IOException

read

public int read(byte[] buf)
         throws java.io.IOException
Overrides:
read in class java.io.RandomAccessFile
Throws:
java.io.IOException

read

public int read(byte[] buf,
                int offset,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.RandomAccessFile
Throws:
java.io.IOException

seek

public void seek(long filePos)
          throws java.io.IOException
Overrides:
seek in class java.io.RandomAccessFile
Throws:
java.io.IOException

getFilePointer

public long getFilePointer()
                    throws java.io.IOException
Overrides:
getFilePointer in class java.io.RandomAccessFile
Throws:
java.io.IOException

fillBuffer

private void fillBuffer()
                 throws java.io.IOException
Throws:
java.io.IOException