|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.at4j.zip.comp.LzmaCompressionMethod
public class LzmaCompressionMethod
This is the LZMA compression method. It is supported using the
LzmaInputStream implementation.
This class cannot be instantiated. Use the singleton instance
DEFAULT_INSTANCE instead.
| Field Summary | |
|---|---|
static UnsignedShort |
CODE
The unique code for this compression method. |
static LzmaCompressionMethod |
DEFAULT_INSTANCE
Singleton instance. |
static String |
NAME
|
static UnsignedShort |
VERSION_NEEDED_TO_EXTRACT
The PK-Zip version needed to extract entries compressed with this compression method. |
| Constructor Summary | |
|---|---|
LzmaCompressionMethod(LzmaOutputStreamSettings settings)
Create a new LZMA compression method object with settings for creating compression output streams. |
|
| Method Summary | |
|---|---|
LzmaCompressionMethod |
create(ZipGeneralPurposeBitFlags gbBitFlags)
Create a compression method instance. |
InputStream |
createInputStream(InputStream is,
long compressedSize,
long uncompressedSize)
Create an InputStream that clients can use to read uncompressed
file data from. |
OutputStream |
createOutputStream(OutputStream os)
Create an OutputStream that compresses the data written to it and
writes it to the wrapped output stream. |
RandomAccess |
createRandomAccess(RandomAccess ra,
long compressedSize,
long uncompressedSize)
This method always throws an UnsupportedOperationException. |
ZipEntryCompressionMethod |
createWithCompressionLevel(CompressionLevel level)
Create a new ZipEntryCompressionMethod object that will have the
supplied compression level. |
UnsignedShort |
getCode()
Get the unique code that is used to identify this compression method in a Zip entry's header. |
String |
getName()
Get a human-readable name for the compression method. |
UnsignedShort |
getVersionNeededToExtract()
Get the PK-Zip version needed to extract Zip entries compressed by this compression method. |
boolean |
isRandomAccessSupported()
This method always returns false |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final UnsignedShort CODE
public static final String NAME
public static final UnsignedShort VERSION_NEEDED_TO_EXTRACT
ZipEntryCompressionMethod.getVersionNeededToExtract().
public static final LzmaCompressionMethod DEFAULT_INSTANCE
| Constructor Detail |
|---|
public LzmaCompressionMethod(LzmaOutputStreamSettings settings)
throws IllegalArgumentException
settings - Settings for the compressing output streams created by
this object. This has no effect on the decompressing input streams
created by this object. This settings object should have its writeUncompressedDataSize property set to false and its writeStreamProperties property set to true.
IllegalArgumentException - If the writeUncompressedDataSize
property for the settings object is true or if the writeStreamProperties property is false.| Method Detail |
|---|
public UnsignedShort getCode()
ZipEntryCompressionMethod
getCode in interface ZipEntryCompressionMethodgetCode in interface ZipEntryCompressionMethodFactorypublic String getName()
ZipEntryCompressionMethod
getName in interface ZipEntryCompressionMethodpublic UnsignedShort getVersionNeededToExtract()
ZipEntryCompressionMethod
getVersionNeededToExtract in interface ZipEntryCompressionMethodUnsignedShort representing the version number. 10 corresponds to version 1.0, 62 to 6.2, etc.
public InputStream createInputStream(InputStream is,
long compressedSize,
long uncompressedSize)
throws IOException
ZipEntryCompressionMethodInputStream that clients can use to read uncompressed
file data from.
createInputStream in interface ZipEntryCompressionMethodis - An open InputStream on the compressed file data.compressedSize - The total size of the compressed data.uncompressedSize - The total size of the uncompressed data.
InputStream containing uncompressed file data.
IOException - On I/O errors.
public OutputStream createOutputStream(OutputStream os)
throws IOException,
UnsupportedCompressionMethodException
ZipEntryCompressionMethodOutputStream that compresses the data written to it and
writes it to the wrapped output stream. This is used when building Zip
files.
createOutputStream in interface ZipEntryCompressionMethodos - The wrapped output stream.
IOException - On I/O errors.
UnsupportedCompressionMethodException - If the compression method
is not supported.
public RandomAccess createRandomAccess(RandomAccess ra,
long compressedSize,
long uncompressedSize)
throws UnsupportedOperationException
UnsupportedOperationException.
createRandomAccess in interface ZipEntryCompressionMethodra - 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.
RandomAccess that can be used to read
uncompressed data.
UnsupportedOperationException - Always.public boolean isRandomAccessSupported()
false
isRandomAccessSupported in interface ZipEntryCompressionMethodfalse, always.public String toString()
toString in class Objectpublic LzmaCompressionMethod create(ZipGeneralPurposeBitFlags gbBitFlags)
ZipEntryCompressionMethodFactory
create in interface ZipEntryCompressionMethodFactorygbBitFlags - The Zip entry's general purpose bit flags. They may
contain compression algorithm parameters.
public ZipEntryCompressionMethod createWithCompressionLevel(CompressionLevel level)
ZipEntryCompressionMethodZipEntryCompressionMethod 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.
createWithCompressionLevel in interface ZipEntryCompressionMethodlevel - The compression level.
this since ZipEntryCompressionMethod objects are
immutable.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||