org.basex.query.util.archive
Class ArchiveIn

java.lang.Object
  extended by org.basex.query.util.archive.ArchiveIn
Direct Known Subclasses:
GZIPIn, ZIPIn

public abstract class ArchiveIn
extends java.lang.Object

Archive reader.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Constructor Summary
ArchiveIn()
           
 
Method Summary
abstract  void close()
          Closes the stream.
abstract  java.util.zip.ZipEntry entry()
          Returns the current entry.
abstract  java.lang.String format()
          Returns the name of the archive format.
static ArchiveIn get(BufferInput bi, InputInfo info)
          Returns a new instance of an archive reader.
abstract  boolean more()
          Indicates if the archive contains more entries.
 byte[] read()
          Reads the next entry.
abstract  int read(byte[] d)
          Reads data from the archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveIn

public ArchiveIn()
Method Detail

get

public static ArchiveIn get(BufferInput bi,
                            InputInfo info)
                     throws QueryException
Returns a new instance of an archive reader.

Parameters:
bi - buffer input
info - input info
Returns:
reader
Throws:
QueryException - query exception

more

public abstract boolean more()
                      throws java.io.IOException
Indicates if the archive contains more entries.

Returns:
result of check
Throws:
java.io.IOException - I/O exception

entry

public abstract java.util.zip.ZipEntry entry()
Returns the current entry.

Returns:
entry

format

public abstract java.lang.String format()
Returns the name of the archive format.

Returns:
name

read

public abstract int read(byte[] d)
                  throws java.io.IOException
Reads data from the archive.

Parameters:
d - data buffer
Returns:
number of read bytes
Throws:
java.io.IOException - I/O exception

read

public byte[] read()
            throws java.io.IOException
Reads the next entry.

Returns:
entry
Throws:
java.io.IOException - I/O exception

close

public abstract void close()
Closes the stream.