TrueZIP Kernel 7.0-rc2

de.schlichtherle.truezip.rof
Class AbstractReadOnlyFile

java.lang.Object
  extended by de.schlichtherle.truezip.rof.AbstractReadOnlyFile
All Implemented Interfaces:
ReadOnlyFile, Closeable
Direct Known Subclasses:
ByteArrayReadOnlyFile, DecoratingReadOnlyFile

@ThreadSafe
public abstract class AbstractReadOnlyFile
extends Object
implements ReadOnlyFile

An abstract read only file which implements the common boilerplate.

Author:
Christian Schlichtherle

Constructor Summary
AbstractReadOnlyFile()
           
 
Method Summary
 int read(byte[] b)
          Equivalent to read(b, 0, b.length).
 void readFully(byte[] b)
          Equivalent to readFully(b, 0, b.length).
 void readFully(byte[] buf, int off, int len)
          Reads len bytes into the given buffer at the given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.schlichtherle.truezip.rof.ReadOnlyFile
close, getFilePointer, length, read, read, seek
 

Constructor Detail

AbstractReadOnlyFile

public AbstractReadOnlyFile()
Method Detail

read

public final int read(byte[] b)
               throws IOException
Description copied from interface: ReadOnlyFile
Equivalent to read(b, 0, b.length).

Specified by:
read in interface ReadOnlyFile
Throws:
IOException

readFully

public final void readFully(byte[] b)
                     throws IOException
Description copied from interface: ReadOnlyFile
Equivalent to readFully(b, 0, b.length).

Specified by:
readFully in interface ReadOnlyFile
Throws:
IOException

readFully

public final void readFully(byte[] buf,
                            int off,
                            int len)
                     throws IOException
Description copied from interface: ReadOnlyFile
Reads len bytes into the given buffer at the given position.

Specified by:
readFully in interface ReadOnlyFile
Parameters:
buf - The buffer to fill with data.
off - The start offset of the data.
len - The number of bytes to read.
Throws:
IOException - On any I/O related issue.

TrueZIP Kernel 7.0-rc2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.