aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib/io/zlib_inputstream.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/lib/io/zlib_inputstream.h')
-rw-r--r--tensorflow/core/lib/io/zlib_inputstream.h27
1 files changed, 5 insertions, 22 deletions
diff --git a/tensorflow/core/lib/io/zlib_inputstream.h b/tensorflow/core/lib/io/zlib_inputstream.h
index 37339163ee..ac9e23ca97 100644
--- a/tensorflow/core/lib/io/zlib_inputstream.h
+++ b/tensorflow/core/lib/io/zlib_inputstream.h
@@ -16,8 +16,6 @@ limitations under the License.
#ifndef TENSORFLOW_LIB_IO_ZLIB_INPUTSTREAM_H_
#define TENSORFLOW_LIB_IO_ZLIB_INPUTSTREAM_H_
-#include <zlib.h>
-
#include <string>
#include "tensorflow/core/lib/core/status.h"
@@ -30,6 +28,10 @@ limitations under the License.
namespace tensorflow {
namespace io {
+// Forward declare some members of zlib.h, which is only included in the
+// .cc file.
+struct ZStreamDef;
+
// An ZlibInputStream provides support for reading from a stream compressed
// using zlib (http://www.zlib.net/). Buffers the contents of the file.
//
@@ -79,28 +81,9 @@ class ZlibInputStream : public InputStreamInterface {
size_t output_buffer_capacity_; // Size of z_stream_output_
char* next_unread_byte_; // Next unread byte in z_stream_output_
- // Buffer for storing contents read from compressed stream.
- // TODO(srbs): Consider using circular buffers. That would greatly simplify
- // the implementation.
- std::unique_ptr<Bytef[]> z_stream_input_;
-
- // Buffer for storing inflated contents of `input_stream_`.
- std::unique_ptr<Bytef[]> z_stream_output_;
-
ZlibCompressionOptions const zlib_options_;
- // Configuration passed to `inflate`.
- //
- // z_stream_->next_in:
- // Next byte to de-compress. Points to some byte in z_stream_input_ buffer.
- // z_stream_->avail_in:
- // Number of bytes available to be decompressed at this time.
- // z_stream_->next_out:
- // Next byte to write de-compressed data to. Points to some byte in
- // z_stream_output_ buffer.
- // z_stream_->avail_out:
- // Number of free bytes available at write location.
- std::unique_ptr<z_stream> z_stream_;
+ std::unique_ptr<ZStreamDef> z_stream_def_;
// Reads data from `input_stream_` and tries to fill up `z_stream_input_` if
// enough unread data is left in `input_stream_`.