OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_BASE_DECOMPRESSOR_H_ |
| 6 #define REMOTING_BASE_DECOMPRESSOR_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 |
| 10 namespace remoting { |
| 11 |
| 12 // An object to decompress data losslessly. This is used in pair with |
| 13 // a compressor. |
| 14 // |
| 15 // Note that a decompressor can only be used on one stream during its |
| 16 // lifetime. This object should be destroyed after use. |
| 17 class Decompressor { |
| 18 public: |
| 19 virtual ~Decompressor() {} |
| 20 |
| 21 // Decompress |input_data| with |input_size| bytes. |
| 22 // |
| 23 // |output_data| is provided by the caller and |output_size| is the |
| 24 // size of |output_data|. |output_size| must be greater than 0. |
| 25 // |
| 26 // Decompressed data is written to |output_data|. |consumed| will |
| 27 // contain the number of bytes consumed from the input. |written| |
| 28 // contains the number of bytes written to output. |
| 29 // |
| 30 // Returns true if this method needs to be called again because |
| 31 // there is more bytes to be decompressed or more input data is |
| 32 // needed. |
| 33 virtual bool Process(const uint8* input_data, int input_size, |
| 34 uint8* output_data, int output_size, |
| 35 int* consumed, int* written) = 0; |
| 36 }; |
| 37 |
| 38 } // namespace remoting |
| 39 |
| 40 #endif // REMOTING_BASE_DECOMPRESSOR_H_ |
OLD | NEW |