aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream/zlib.h
diff options
context:
space:
mode:
authorAlexander Fokin <apfokin@gmail.com>2022-02-10 16:45:38 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:38 +0300
commit863a59a65247c24db7cb06789bc5cf79d04da32f (patch)
tree139dc000c8cd4a40f5659e421b7c75135d080307 /util/stream/zlib.h
parentf64e95a9eb9ab03240599eb9581c5a9102426a96 (diff)
downloadydb-863a59a65247c24db7cb06789bc5cf79d04da32f.tar.gz
Restoring authorship annotation for Alexander Fokin <apfokin@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/stream/zlib.h')
-rw-r--r--util/stream/zlib.h66
1 files changed, 33 insertions, 33 deletions
diff --git a/util/stream/zlib.h b/util/stream/zlib.h
index e7de7c81b7..084a99a41b 100644
--- a/util/stream/zlib.h
+++ b/util/stream/zlib.h
@@ -1,19 +1,19 @@
#pragma once
#include "fwd.h"
-#include "input.h"
-#include "output.h"
-#include "buffered.h"
+#include "input.h"
+#include "output.h"
+#include "buffered.h"
#include <util/system/defaults.h>
#include <util/generic/ptr.h>
#include <util/generic/yexception.h>
-/**
- * @addtogroup Streams_Archs
- * @{
- */
-
+/**
+ * @addtogroup Streams_Archs
+ * @{
+ */
+
struct TZLibError: public yexception {
};
@@ -31,20 +31,20 @@ namespace ZLib {
Raw = 3,
Invalid = 4
};
-
- enum {
- ZLIB_BUF_LEN = 8 * 1024
- };
+
+ enum {
+ ZLIB_BUF_LEN = 8 * 1024
+ };
}
/**
- * Non-buffered ZLib decompressing stream.
+ * Non-buffered ZLib decompressing stream.
*
- * Please don't use `TZLibDecompress` if you read text data from stream using
- * `ReadLine`, it is VERY slow (approx 10 times slower, according to synthetic
- * benchmark). For fast buffered ZLib stream reading use `TBufferedZLibDecompress`
- * aka `TZDecompress`.
- */
+ * Please don't use `TZLibDecompress` if you read text data from stream using
+ * `ReadLine`, it is VERY slow (approx 10 times slower, according to synthetic
+ * benchmark). For fast buffered ZLib stream reading use `TBufferedZLibDecompress`
+ * aka `TZDecompress`.
+ */
class TZLibDecompress: public IInputStream {
public:
TZLibDecompress(IZeroCopyInput* input, ZLib::StreamType type = ZLib::Auto, TStringBuf dict = {});
@@ -63,18 +63,18 @@ public:
void SetAllowMultipleStreams(bool allowMultipleStreams);
~TZLibDecompress() override;
-
-protected:
+
+protected:
size_t DoRead(void* buf, size_t size) override;
-
+
public:
class TImpl;
THolder<TImpl> Impl_;
};
-/**
- * Non-buffered ZLib compressing stream.
- */
+/**
+ * Non-buffered ZLib compressing stream.
+ */
class TZLibCompress: public IOutputStream {
public:
struct TParams {
@@ -82,7 +82,7 @@ public:
: Out(out)
, Type(ZLib::ZLib)
, CompressionLevel(6)
- , BufLen(ZLib::ZLIB_BUF_LEN)
+ , BufLen(ZLib::ZLIB_BUF_LEN)
{
}
@@ -145,7 +145,7 @@ private:
public:
class TImpl;
- /** To allow inline constructors. */
+ /** To allow inline constructors. */
struct TDestruct {
static void Destroy(TImpl* impl);
};
@@ -153,12 +153,12 @@ public:
THolder<TImpl, TDestruct> Impl_;
};
-/**
- * Buffered ZLib decompressing stream.
- *
- * Supports efficient `ReadLine` calls and similar "reading in small pieces"
- * usage patterns.
- */
+/**
+ * Buffered ZLib decompressing stream.
+ *
+ * Supports efficient `ReadLine` calls and similar "reading in small pieces"
+ * usage patterns.
+ */
class TBufferedZLibDecompress: public TBuffered<TZLibDecompress> {
public:
template <class T>
@@ -170,4 +170,4 @@ public:
~TBufferedZLibDecompress() override;
};
-/** @} */
+/** @} */