Class CompressionActivator
java.lang.Object
org.openstreetmap.osmosis.xml.common.CompressionActivator
A utility class for layering compression streams on top of underlying byte
streams based upon a specified compression algorithm.
-
Constructor Summary
ConstructorsConstructorDescriptionCompressionActivator(CompressionMethod compressionMethod) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncreateCompressionInputStream(InputStream sourceStream) Wraps a compression stream around the source stream based upon the requested compression method.createCompressionOutputStream(OutputStream destinationStream) Wraps a compression stream around the destination stream based upon the requested compression method.
-
Constructor Details
-
CompressionActivator
Creates a new instance.- Parameters:
compressionMethod- The compression method to employ.
-
-
Method Details
-
createCompressionOutputStream
Wraps a compression stream around the destination stream based upon the requested compression method. If this method returns successfully, the input destination stream does not require closing after use because it will be closed when the returned output stream is closed.- Parameters:
destinationStream- The destination stream for receiving compressed data.- Returns:
- A stream for writing compressed data to the destination stream.
-
createCompressionInputStream
Wraps a compression stream around the source stream based upon the requested compression method. If this method returns successfully, the input source stream does not require closing after use because it will be closed when the returned input stream is closed.- Parameters:
sourceStream- The source stream for providing compressed data.- Returns:
- A stream for writing compressed data to the destination stream.
-