TrueZIP 6.8

de.schlichtherle.io.archive.tar
Class TarBZip2Driver

java.lang.Object
  extended by de.schlichtherle.io.archive.spi.AbstractArchiveDriver
      extended by de.schlichtherle.io.archive.tar.TarDriver
          extended by de.schlichtherle.io.archive.tar.TarBZip2Driver
All Implemented Interfaces:
ArchiveDriver, Serializable

public class TarBZip2Driver
extends TarDriver

An archive driver which builds TAR files compressed with BZIP2.

Instances of this class are immutable.

Since:
TrueZIP 6.0
Version:
$Id: TarBZip2Driver.java,v 1.4 2010/08/20 13:09:44 christian_schlichtherle Exp $
Author:
Christian Schlichtherle
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.schlichtherle.io.archive.spi.AbstractArchiveDriver
AbstractArchiveDriver.InconsistentCharsetSupportError
 
Field Summary
static int DEFAULT_BLOCKSIZE
          The default block size to use when writing a BZIP2 output stream, which is 9.
static int DEFAULT_LEVEL
          Deprecated. Use DEFAULT_BLOCKSIZE instead.
static int MAX_BLOCKSIZE
          The maximum block size to use when writing a BZIP2 output stream, which is 9.
static int MIN_BLOCKSIZE
          The minimum block size to use when writing a BZIP2 output stream, which is 1.
 
Fields inherited from class de.schlichtherle.io.archive.tar.TarDriver
DEFAULT_CHARSET
 
Constructor Summary
TarBZip2Driver()
          Equivalent to this(DEFAULT_CHARSET, null, null, DEFAULT_BLOCKSIZE).
TarBZip2Driver(int inBlockSize)
          Equivalent to this(DEFAULT_CHARSET, null, null, inBlockSize).
TarBZip2Driver(String charset)
          Equivalent to this(charset, null, null, DEFAULT_BLOCKSIZE).
TarBZip2Driver(String charset, Icon openIcon, Icon closedIcon, int inBlockSize)
          Constructs a new TAR.BZ2 driver.
TarBZip2Driver(String charset, int inBlockSize)
          Equivalent to this(charset, null, null, inBlockSize).
 
Method Summary
protected  InputStream createInputStream(Archive archive, ReadOnlyFile rof)
          Returns a newly created and verified CBZip2InputStream.
protected  TarOutputArchive createTarOutputArchive(Archive archive, OutputStream out, TarInputArchive source)
           
 int getLevel()
          Returns the value of the property inBlockSize which was provided to the constructor.
 
Methods inherited from class de.schlichtherle.io.archive.tar.TarDriver
createArchiveEntry, createInputArchive, createOutputArchive, createTarInputArchive
 
Methods inherited from class de.schlichtherle.io.archive.spi.AbstractArchiveDriver
ensureEncodable, getCharset, getClosedIcon, getEncoding, getOpenIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.schlichtherle.io.archive.spi.ArchiveDriver
equals, hashCode
 

Field Detail

MIN_BLOCKSIZE

public static final int MIN_BLOCKSIZE
The minimum block size to use when writing a BZIP2 output stream, which is 1.

See Also:
Constant Field Values

MAX_BLOCKSIZE

public static final int MAX_BLOCKSIZE
The maximum block size to use when writing a BZIP2 output stream, which is 9.

See Also:
Constant Field Values

DEFAULT_BLOCKSIZE

public static final int DEFAULT_BLOCKSIZE
The default block size to use when writing a BZIP2 output stream, which is 9.

See Also:
Constant Field Values

DEFAULT_LEVEL

public static final int DEFAULT_LEVEL
Deprecated. Use DEFAULT_BLOCKSIZE instead.
See Also:
Constant Field Values
Constructor Detail

TarBZip2Driver

public TarBZip2Driver()
Equivalent to this(DEFAULT_CHARSET, null, null, DEFAULT_BLOCKSIZE).


TarBZip2Driver

public TarBZip2Driver(String charset)
Equivalent to this(charset, null, null, DEFAULT_BLOCKSIZE).


TarBZip2Driver

public TarBZip2Driver(int inBlockSize)
Equivalent to this(DEFAULT_CHARSET, null, null, inBlockSize).


TarBZip2Driver

public TarBZip2Driver(String charset,
                      int inBlockSize)
Equivalent to this(charset, null, null, inBlockSize).


TarBZip2Driver

public TarBZip2Driver(String charset,
                      Icon openIcon,
                      Icon closedIcon,
                      int inBlockSize)
Constructs a new TAR.BZ2 driver.

Parameters:
inBlockSize - The compression block size to use when writing a BZIP2 output stream.
Throws:
IllegalArgumentException - If inBlockSize is not in the range [1..9].
Method Detail

getLevel

public final int getLevel()
Returns the value of the property inBlockSize which was provided to the constructor.


createInputStream

protected InputStream createInputStream(Archive archive,
                                        ReadOnlyFile rof)
                                 throws IOException
Returns a newly created and verified CBZip2InputStream. This method performs a simple verification by computing the checksum for the first record only. This method is required because the CBZip2InputStream unfortunately does not do sufficient verification!

Overrides:
createInputStream in class TarDriver
Throws:
IOException

createTarOutputArchive

protected TarOutputArchive createTarOutputArchive(Archive archive,
                                                  OutputStream out,
                                                  TarInputArchive source)
                                           throws IOException
Overrides:
createTarOutputArchive in class TarDriver
Throws:
IOException

TrueZIP 6.8

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