Class Pack200CompressorInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.compress.compressors.CompressorInputStream
org.apache.commons.compress.compressors.pack200.Pack200CompressorInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An input stream that decompresses from the Pack200 format to be read
as any other stream.
The getCount and getBytesRead methods always
return 0.
- Since:
- 1.3
- This class is not thread-safe
-
Constructor Summary
ConstructorsConstructorDescriptionDecompresses the given file, caching the decompressed data in memory.Pack200CompressorInputStream(File f, Map<String, String> props) Decompresses the given file, caching the decompressed data in memory and using the given properties.Decompresses the given file using the given strategy to cache the results.Pack200CompressorInputStream(File f, Pack200Strategy mode, Map<String, String> props) Decompresses the given file using the given strategy to cache the results and the given properties.Decompresses the given stream, caching the decompressed data in memory.Pack200CompressorInputStream(InputStream in, Map<String, String> props) Decompresses the given stream, caching the decompressed data in memory and using the given properties.Decompresses the given stream using the given strategy to cache the results.Pack200CompressorInputStream(InputStream in, Pack200Strategy mode, Map<String, String> props) Decompresses the given stream using the given strategy to cache the results and the given properties. -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()voidmark(int limit) booleanstatic 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
count, count, getBytesRead, getCount, getUncompressedCount, pushedBackBytes
-
Constructor Details
-
Pack200CompressorInputStream
Decompresses the given file, caching the decompressed data in memory.- Parameters:
f- the file to decompress- Throws:
IOException- if reading fails
-
Pack200CompressorInputStream
Decompresses the given file, caching the decompressed data in memory and using the given properties.- Parameters:
f- the file to decompressprops- Pack200 properties to use- Throws:
IOException- if reading fails
-
Pack200CompressorInputStream
Decompresses the given file using the given strategy to cache the results.- Parameters:
f- the file to decompressmode- the strategy to use- Throws:
IOException- if reading fails
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(File f, Pack200Strategy mode, Map<String, String> props) throws IOExceptionDecompresses the given file using the given strategy to cache the results and the given properties.- Parameters:
f- the file to decompressmode- the strategy to useprops- Pack200 properties to use- Throws:
IOException- if reading fails
-
Pack200CompressorInputStream
Decompresses the given stream, caching the decompressed data in memory.When reading from a file the File-arg constructor may provide better performance.
- Parameters:
in- the InputStream from which this object should be created- Throws:
IOException- if reading fails
-
Pack200CompressorInputStream
Decompresses 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:
in- the InputStream from which this object should be createdprops- Pack200 properties to use- Throws:
IOException- if reading fails
-
Pack200CompressorInputStream
Decompresses 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:
in- the InputStream from which this object should be createdmode- the strategy to use- Throws:
IOException- if reading fails
-
Pack200CompressorInputStream
public Pack200CompressorInputStream(InputStream in, Pack200Strategy mode, Map<String, String> props) throws 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:
in- the InputStream from which this object should be createdmode- the strategy to useprops- Pack200 properties to use- Throws:
IOException- if reading fails
-
-
Method Details
-
matches
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
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
- Overrides:
markin classInputStream
-
markSupported
- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-