com.github.junrar.io
Class ReadOnlyAccessFile

java.lang.Object
  extended by java.io.RandomAccessFile
      extended by com.github.junrar.io.ReadOnlyAccessFile
All Implemented Interfaces:
IReadOnlyAccess, Closeable, DataInput, DataOutput

public class ReadOnlyAccessFile
extends RandomAccessFile
implements IReadOnlyAccess

DOCUMENT ME

Version:
$LastChangedRevision$
Author:
$LastChangedBy$

Constructor Summary
ReadOnlyAccessFile(File file)
           
 
Method Summary
 long getPosition()
           
 int readFully(byte[] buffer, int count)
          Read exactly count bytes to the specified buffer.
 void setPosition(long pos)
           
 
Methods inherited from class java.io.RandomAccessFile
close, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, 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 com.github.junrar.io.IReadOnlyAccess
close, read, read
 

Constructor Detail

ReadOnlyAccessFile

public ReadOnlyAccessFile(File file)
                   throws FileNotFoundException
Parameters:
file - the file
Throws:
FileNotFoundException
Method Detail

readFully

public int readFully(byte[] buffer,
                     int count)
              throws IOException
Description copied from interface: IReadOnlyAccess
Read exactly count bytes to the specified buffer.

Specified by:
readFully in interface IReadOnlyAccess
Parameters:
buffer - where to store the read data
count - how many bytes to read
Returns:
bytes read || -1 if IO problem
Throws:
IOException

getPosition

public long getPosition()
                 throws IOException
Specified by:
getPosition in interface IReadOnlyAccess
Returns:
the current position in the file
Throws:
IOException

setPosition

public void setPosition(long pos)
                 throws IOException
Specified by:
setPosition in interface IReadOnlyAccess
Parameters:
pos - the position in the file
Throws:
IOException


Copyright © 2012. All Rights Reserved.