org.basex.query.util.archive
Class ArchiveOut

java.lang.Object
  extended by org.basex.query.util.archive.ArchiveOut
Direct Known Subclasses:
GZIPOut, ZIPOut

public abstract class ArchiveOut
extends java.lang.Object

Archive writer.

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

Constructor Summary
ArchiveOut()
           
 
Method Summary
abstract  void close()
          Closes the stream.
static ArchiveOut get(java.lang.String format, InputInfo info)
          Returns a new instance of an archive writer.
abstract  void level(int l)
          Sets the compression level.
 byte[] toArray()
          Returns the output as byte array.
abstract  void write(ArchiveIn in)
          Writes data from the specified archive.
abstract  void write(java.util.zip.ZipEntry entry, byte[] val)
          Writes the specified entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveOut

public ArchiveOut()
Method Detail

get

public static ArchiveOut get(java.lang.String format,
                             InputInfo info)
                      throws QueryException
Returns a new instance of an archive writer.

Parameters:
format - archive format
info - input info
Returns:
writer
Throws:
QueryException - query exception

level

public abstract void level(int l)
Sets the compression level.

Parameters:
l - level

write

public abstract void write(ArchiveIn in)
                    throws java.io.IOException
Writes data from the specified archive.

Parameters:
in - input archive
Throws:
java.io.IOException - I/O exception

write

public abstract void write(java.util.zip.ZipEntry entry,
                           byte[] val)
                    throws java.io.IOException
Writes the specified entry.

Parameters:
entry - zip entry
val - value to be written
Throws:
java.io.IOException - I/O exception

close

public abstract void close()
Closes the stream.


toArray

public final byte[] toArray()
Returns the output as byte array.

Returns:
byte array