org.at4j.zip.comp
Class AbstractUnsupportedCompressionMethod

java.lang.Object
  extended by org.at4j.zip.comp.AbstractUnsupportedCompressionMethod
All Implemented Interfaces:
ZipEntryCompressionMethod
Direct Known Subclasses:
Deflate64CompressionMethod, IbmLz77CompressionMethod, IbmTerseCompressionMethod, ImplodedCompressionMethod, PKWareImplodingCompressionMethod, PpmdCompressionMethod, Reduced1CompressionMethod, Reduced2CompressionMethod, Reduced3CompressionMethod, Reduced4CompressionMethod, ShrunkCompressionMethod, WavPackCompressionMethod

public abstract class AbstractUnsupportedCompressionMethod
extends Object
implements ZipEntryCompressionMethod

This class may be inherited by unsupported compression method.

Since:
1.0.2
Author:
Karl Gustafsson

Constructor Summary
AbstractUnsupportedCompressionMethod()
           
 
Method Summary
 InputStream createInputStream(InputStream is, long compressedSize, long uncompressedSize)
          This method always throws an UnsupportedCompressionMethodException.
 OutputStream createOutputStream(OutputStream os)
          This method always throws an UnsupportedCompressionMethodException.
 RandomAccess createRandomAccess(RandomAccess ra, long compressedSize, long uncompressedSize)
          This method always throws an UnsupportedCompressionMethodException.
 ZipEntryCompressionMethod createWithCompressionLevel(CompressionLevel level)
          Create a new ZipEntryCompressionMethod object that will have the supplied compression level.
 boolean isRandomAccessSupported()
          This method always returns false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.at4j.zip.comp.ZipEntryCompressionMethod
getCode, getName, getVersionNeededToExtract
 

Constructor Detail

AbstractUnsupportedCompressionMethod

public AbstractUnsupportedCompressionMethod()
Method Detail

createInputStream

public final InputStream createInputStream(InputStream is,
                                           long compressedSize,
                                           long uncompressedSize)
                                    throws UnsupportedCompressionMethodException
This method always throws an UnsupportedCompressionMethodException.

Specified by:
createInputStream in interface ZipEntryCompressionMethod
Parameters:
is - An open InputStream on the compressed file data.
compressedSize - The total size of the compressed data.
uncompressedSize - The total size of the uncompressed data.
Returns:
An open InputStream containing uncompressed file data.
Throws:
UnsupportedCompressionMethodException - Always.

createOutputStream

public final OutputStream createOutputStream(OutputStream os)
                                      throws UnsupportedCompressionMethodException
This method always throws an UnsupportedCompressionMethodException.

Specified by:
createOutputStream in interface ZipEntryCompressionMethod
Parameters:
os - The wrapped output stream.
Returns:
A compressing output stream.
Throws:
UnsupportedCompressionMethodException - Always.

createRandomAccess

public final RandomAccess createRandomAccess(RandomAccess ra,
                                             long compressedSize,
                                             long uncompressedSize)
                                      throws UnsupportedCompressionMethodException
This method always throws an UnsupportedCompressionMethodException.

Specified by:
createRandomAccess in interface ZipEntryCompressionMethod
Parameters:
ra - An open random access object on the file entry's data.
compressedSize - The total size of the compressed data.
uncompressedSize - The total size of the uncompressed data.
Returns:
On open RandomAccess that can be used to read uncompressed data.
Throws:
UnsupportedCompressionMethodException - Always.

isRandomAccessSupported

public final boolean isRandomAccessSupported()
This method always returns false

Specified by:
isRandomAccessSupported in interface ZipEntryCompressionMethod
Returns:
false, always.

createWithCompressionLevel

public final ZipEntryCompressionMethod createWithCompressionLevel(CompressionLevel level)
Description copied from interface: ZipEntryCompressionMethod
Create a new ZipEntryCompressionMethod object that will have the supplied compression level.

The reason for this method is that it makes it easier to set a custom compression level for a compression method, without having to create a new compression method object from scratch manually.

Specified by:
createWithCompressionLevel in interface ZipEntryCompressionMethod
Parameters:
level - The compression level.
Returns:
this