Home | History | Annotate | Download | only in shared
      1 // Copyright 2015 Google Inc. All rights reserved.
      2 //
      3 // Licensed under the Apache License, Version 2.0 (the "License");
      4 // you may not use this file except in compliance with the License.
      5 // You may obtain a copy of the License at
      6 //
      7 //     http://www.apache.org/licenses/LICENSE-2.0
      8 //
      9 // Unless required by applicable law or agreed to in writing, software
     10 // distributed under the License is distributed on an "AS IS" BASIS,
     11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 // See the License for the specific language governing permissions and
     13 // limitations under the License.
     14 
     15 package com.google.archivepatcher.shared;
     16 
     17 import java.io.IOException;
     18 import java.io.InputStream;
     19 import java.io.OutputStream;
     20 
     21 /**
     22  * An interface for implementing a streaming uncompressor. An uncompressor may be used to uncompress
     23  * data that was previously compressed by the corresponding {@link Compressor} implementation, and
     24  * always operates in a streaming manner.
     25  */
     26 public interface Uncompressor {
     27   /**
     28    * Uncompresses data that was previously processed by the corresponding {@link Compressor}
     29    * implementation, writing the uncompressed data into uncompressedOut.
     30    *
     31    * @param compressedIn the compressed data
     32    * @param uncompressedOut the uncompressed data
     33    * @throws IOException if something goes awry while reading or writing
     34    */
     35   public void uncompress(InputStream compressedIn, OutputStream uncompressedOut) throws IOException;
     36 }
     37