de.schlichtherle.io.rof
Class FastReadOnlyFile

java.lang.Object
  extended by java.io.RandomAccessFile
      extended by de.schlichtherle.io.rof.FastReadOnlyFile
All Implemented Interfaces:
ReadOnlyFile, Closeable, DataInput, DataOutput

Deprecated. Depending on the implementation of the J2SE API, this class most likely does not provide any performance improvement. Use where necessary only!

public class FastReadOnlyFile
extends RandomAccessFile
implements ReadOnlyFile

A ReadOnlyFile implementation using a RandomAccessFile with a cached file pointer. This implementation skips unnecessary file pointer operations for the operating system.

Version:
TrueZIP 6.7
Author:
Christian Schlichtherle

Constructor Summary
FastReadOnlyFile(File file)
          Deprecated.  
 
Method Summary
 void close()
          Deprecated.  
 long getFilePointer()
          Deprecated.  
 int read()
          Deprecated.  
 int read(byte[] b, int off, int len)
          Deprecated. Reads up to len bytes of data from this read only file into the given array.
 void seek(long pos)
          Deprecated. Sets the file pointer offset, measured from the beginning of this file, at which the next read occurs.
 
Methods inherited from class java.io.RandomAccessFile
getChannel, getFD, length, read, 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
 
Methods inherited from interface de.schlichtherle.io.rof.ReadOnlyFile
length, read, readFully, readFully, skipBytes
 

Constructor Detail

FastReadOnlyFile

public FastReadOnlyFile(File file)
                 throws FileNotFoundException
Deprecated. 
Throws:
FileNotFoundException
Method Detail

getFilePointer

public long getFilePointer()
                    throws IOException
Deprecated. 
Specified by:
getFilePointer in interface ReadOnlyFile
Overrides:
getFilePointer in class RandomAccessFile
Throws:
IOException

seek

public void seek(long pos)
          throws IOException
Deprecated. 
Description copied from interface: ReadOnlyFile
Sets the file pointer offset, measured from the beginning of this file, at which the next read occurs. Whether the offset may be set beyond the end of the file is up to the implementor. For example, the SimpleReadOnlyFile subclasses RandomAccessFile and passes "r" as a parameter to the superclass constructor. On the Windows platform, this implementation allows to seek past the end of file, but on the Linux platform it doesn't.

Specified by:
seek in interface ReadOnlyFile
Overrides:
seek in class RandomAccessFile
Parameters:
pos - The offset position, measured in bytes from the beginning of the file, at which to set the file pointer.
Throws:
IOException - If pos is less than 0 or if an I/O error occurs.

read

public int read()
         throws IOException
Deprecated. 
Specified by:
read in interface ReadOnlyFile
Overrides:
read in class RandomAccessFile
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Deprecated. 
Description copied from interface: ReadOnlyFile
Reads up to len bytes of data from this read only file into the given array. This method blocks until at least one byte of input is available.

Specified by:
read in interface ReadOnlyFile
Overrides:
read in class RandomAccessFile
Parameters:
b - The buffer to fill with data.
off - The start offset of the data.
len - The maximum number of bytes to read.
Returns:
The total number of bytes read, or -1 if there is no more data because the end of the file has been reached.
Throws:
IOException - On any I/O related issue.

close

public void close()
           throws IOException
Deprecated. 
Specified by:
close in interface ReadOnlyFile
Specified by:
close in interface Closeable
Overrides:
close in class RandomAccessFile
Throws:
IOException