Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
   * with the License.  You may obtain a copy of the License at
   *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package com.indeed.util.compress;
 
This class encapsulates a streaming compression/decompression pair.
 
 public interface CompressionCodec {

  
Create a CompressionOutputStream that will write to the given java.io.OutputStream.

Parameters:
out the location for the final output stream
Returns:
a stream the user can write uncompressed data to have it compressed
Throws:
java.io.IOException
 
   throws IOException;
  
  
Create a CompressionOutputStream that will write to the given java.io.OutputStream with the given Compressor.

Parameters:
out the location for the final output stream
compressor compressor to use
Returns:
a stream the user can write uncompressed data to have it compressed
Throws:
java.io.IOException
 
                                              Compressor compressor
   throws IOException;

  
Get the type of Compressor needed by this CompressionCodec.

Returns:
the type of compressor needed by this codec.
 
   Class<? extends CompressorgetCompressorType();
  
  
Create a new Compressor for use by this CompressionCodec.

Returns:
a new compressor for use by this codec
 
   Compressor createCompressor();
  
  
Create a CompressionInputStream that will read from the given input stream.

Parameters:
in the stream to read compressed bytes from
Returns:
a stream to read uncompressed bytes from
Throws:
java.io.IOException
 
Create a CompressionInputStream that will read from the given java.io.InputStream with the given Decompressor.

Parameters:
in the stream to read compressed bytes from
decompressor decompressor to use
Returns:
a stream to read uncompressed bytes from
Throws:
java.io.IOException
 
                                            Decompressor decompressor
   throws IOException;


  
Get the type of Decompressor needed by this CompressionCodec.

Returns:
the type of decompressor needed by this codec.
 
   Class<? extends DecompressorgetDecompressorType();
  
  
Create a new Decompressor for use by this CompressionCodec.

Returns:
a new decompressor for use by this codec
Get the default filename extension for this kind of compression.

Returns:
the extension including the '.'
New to GrepCode? Check out our FAQ X