gps.log.in
Class WindowedFile

java.lang.Object
  extended by gps.log.in.WindowedFile

public final class WindowedFile
extends java.lang.Object

This class copes with the inability of the VM to handle random access files when one wants to look at the file content using a forward moving window on the file. The new start position of the window must be at least the previous start position of the window. This class performs the required internal buffer copy and then required file read.

Author:
Mario De Weerd

Constructor Summary
WindowedFile(BT747Path path, int mode)
           
 
Method Summary
 boolean close()
           
 byte[] fillBuffer(int newPosition)
           
 byte[] getBuffer()
           
 int getBufferFill()
           
 int getBufferSize()
           
 int getLastError()
           
 java.lang.String getPath()
           
 int getSize()
           
 boolean isOpen()
           
 void setBufferSize(int bufferSize)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowedFile

public WindowedFile(BT747Path path,
                    int mode)
             throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setBufferSize

public void setBufferSize(int bufferSize)

getBufferSize

public int getBufferSize()

getPath

public java.lang.String getPath()

getLastError

public int getLastError()

isOpen

public boolean isOpen()

getSize

public int getSize()
            throws java.lang.Exception
Throws:
java.lang.Exception

getBuffer

public byte[] getBuffer()
                 throws java.lang.Exception
Throws:
java.lang.Exception

fillBuffer

public final byte[] fillBuffer(int newPosition)

getBufferFill

public final int getBufferFill()

close

public final boolean close()