Class Pack200CompressorInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.compress.compressors.CompressorInputStream
-
- org.apache.commons.compress.compressors.pack200.Pack200CompressorInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class Pack200CompressorInputStream extends CompressorInputStream
An input stream that decompresses from the Pack200 format to be read as any other stream.The
getCountandgetBytesReadmethods always return 0.- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description Pack200CompressorInputStream(java.io.File file)Decompresses the given file, caching the decompressed data in memory.Pack200CompressorInputStream(java.io.File file, java.util.Map<java.lang.String,java.lang.String> properties)Decompresses the given file, caching the decompressed data in memory and using the given properties.Pack200CompressorInputStream(java.io.File file, Pack200Strategy mode)Decompresses the given file using the given strategy to cache the results.Pack200CompressorInputStream(java.io.File file, Pack200Strategy mode, java.util.Map<java.lang.String,java.lang.String> properties)Decompresses the given file using the given strategy to cache the results and the given properties.Pack200CompressorInputStream(java.io.InputStream inputStream)Decompresses the given stream, caching the decompressed data in memory.Pack200CompressorInputStream(java.io.InputStream inputStream, java.util.Map<java.lang.String,java.lang.String> properties)Decompresses the given stream, caching the decompressed data in memory and using the given properties.Pack200CompressorInputStream(java.io.InputStream inputStream, Pack200Strategy mode)Decompresses the given stream using the given strategy to cache the results.Pack200CompressorInputStream(java.io.InputStream inputStream, Pack200Strategy mode, java.util.Map<java.lang.String,java.lang.String> properties)Decompresses the given stream using the given strategy to cache the results and the given properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int limit)booleanmarkSupported()static booleanmatches(byte[] signature, int length)Checks if the signature matches what is expected for a pack200 file (0xCAFED00D).intread()intread(byte[] b)intread(byte[] b, int off, int count)voidreset()longskip(long count)-
Methods inherited from class org.apache.commons.compress.compressors.CompressorInputStream
getBytesRead, getCount, getUncompressedCount
-
-
-
-
Constructor Detail
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(java.io.File file) throws java.io.IOExceptionDecompresses the given file, caching the decompressed data in memory.- Parameters:
file- the file to decompress- Throws:
java.io.IOException- if reading fails
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(java.io.File file, java.util.Map<java.lang.String,java.lang.String> properties) throws java.io.IOExceptionDecompresses the given file, caching the decompressed data in memory and using the given properties.- Parameters:
file- the file to decompressproperties- Pack200 properties to use- Throws:
java.io.IOException- if reading fails
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(java.io.File file, Pack200Strategy mode) throws java.io.IOExceptionDecompresses the given file using the given strategy to cache the results.- Parameters:
file- the file to decompressmode- the strategy to use- Throws:
java.io.IOException- if reading fails
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(java.io.File file, Pack200Strategy mode, java.util.Map<java.lang.String,java.lang.String> properties) throws java.io.IOExceptionDecompresses the given file using the given strategy to cache the results and the given properties.- Parameters:
file- the file to decompressmode- the strategy to useproperties- Pack200 properties to use- Throws:
java.io.IOException- if reading fails
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(java.io.InputStream inputStream) throws java.io.IOExceptionDecompresses the given stream, caching the decompressed data in memory.When reading from a file the File-arg constructor may provide better performance.
- Parameters:
inputStream- the InputStream from which this object should be created- Throws:
java.io.IOException- if reading fails
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(java.io.InputStream inputStream, java.util.Map<java.lang.String,java.lang.String> properties) throws java.io.IOExceptionDecompresses the given stream, caching the decompressed data in memory and using the given properties.When reading from a file the File-arg constructor may provide better performance.
- Parameters:
inputStream- the InputStream from which this object should be createdproperties- Pack200 properties to use- Throws:
java.io.IOException- if reading fails
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(java.io.InputStream inputStream, Pack200Strategy mode) throws java.io.IOExceptionDecompresses the given stream using the given strategy to cache the results.When reading from a file the File-arg constructor may provide better performance.
- Parameters:
inputStream- the InputStream from which this object should be createdmode- the strategy to use- Throws:
java.io.IOException- if reading fails
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(java.io.InputStream inputStream, Pack200Strategy mode, java.util.Map<java.lang.String,java.lang.String> properties) throws java.io.IOExceptionDecompresses the given stream using the given strategy to cache the results and the given properties.When reading from a file the File-arg constructor may provide better performance.
- Parameters:
inputStream- the InputStream from which this object should be createdmode- the strategy to useproperties- Pack200 properties to use- Throws:
java.io.IOException- if reading fails
-
-
Method Detail
-
matches
public static boolean matches(byte[] signature, int length)Checks if the signature matches what is expected for a pack200 file (0xCAFED00D).- Parameters:
signature- the bytes to checklength- the number of bytes to check- Returns:
- true, if this stream is a pack200 compressed stream, false otherwise
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
mark
public void mark(int limit)
- Overrides:
markin classjava.io.InputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int count) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
skip
public long skip(long count) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
-