com.github.junrar.vfs2.provider.rar
Class RandomAccessContentAccess

java.lang.Object
  extended by com.github.junrar.vfs2.provider.rar.RandomAccessContentAccess
All Implemented Interfaces:
IReadOnlyAccess

public class RandomAccessContentAccess
extends Object
implements IReadOnlyAccess

Author:
Rogiel

Constructor Summary
RandomAccessContentAccess(org.apache.commons.vfs2.FileObject file)
           
RandomAccessContentAccess(org.apache.commons.vfs2.RandomAccessContent rac)
           
 
Method Summary
 void close()
          Close this file.
 long getPosition()
           
 int read()
          Read a single byte of data.
 int read(byte[] buffer, int off, int count)
          Read up to count bytes to the specified buffer.
 int readFully(byte[] buffer, int count)
          Read exactly count bytes to the specified buffer.
 void setPosition(long pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomAccessContentAccess

public RandomAccessContentAccess(org.apache.commons.vfs2.RandomAccessContent rac)
Parameters:
rac -

RandomAccessContentAccess

public RandomAccessContentAccess(org.apache.commons.vfs2.FileObject file)
                          throws org.apache.commons.vfs2.FileSystemException
Parameters:
rac -
Throws:
org.apache.commons.vfs2.FileSystemException
Method Detail

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

read

public int read()
         throws IOException
Description copied from interface: IReadOnlyAccess
Read a single byte of data.

Specified by:
read in interface IReadOnlyAccess
Throws:
IOException

read

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

Specified by:
read in interface IReadOnlyAccess
Throws:
IOException

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

close

public void close()
           throws IOException
Description copied from interface: IReadOnlyAccess
Close this file.

Specified by:
close in interface IReadOnlyAccess
Throws:
IOException


Copyright © 2012. All Rights Reserved.