diff options
author | Wu, Ke <wuke@cs.umd.edu> | 2014-12-17 16:11:38 -0500 |
---|---|---|
committer | Wu, Ke <wuke@cs.umd.edu> | 2014-12-17 16:11:38 -0500 |
commit | 7468e8d85e99b4619442c7afaf4a0d92870111bb (patch) | |
tree | a6f17da7c69048c8900260b5490bb9d8611be3bb /klm/util/read_compressed.hh | |
parent | b6dd5a683db9dda2d634dd2fdb76606819594901 (diff) | |
parent | 1a79175f9a101d46cf27ca921213d5dd9300518f (diff) |
Merge with upstream
Diffstat (limited to 'klm/util/read_compressed.hh')
-rw-r--r-- | klm/util/read_compressed.hh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/klm/util/read_compressed.hh b/klm/util/read_compressed.hh index 8b54c9e8..767ee94b 100644 --- a/klm/util/read_compressed.hh +++ b/klm/util/read_compressed.hh @@ -1,5 +1,5 @@ -#ifndef UTIL_READ_COMPRESSED__ -#define UTIL_READ_COMPRESSED__ +#ifndef UTIL_READ_COMPRESSED_H +#define UTIL_READ_COMPRESSED_H #include "util/exception.hh" #include "util/scoped.hh" @@ -62,6 +62,10 @@ class ReadCompressed { std::size_t Read(void *to, std::size_t amount); + // Repeatedly call read to fill a buffer unless EOF is hit. + // Return number of bytes read. + std::size_t ReadOrEOF(void *const to, std::size_t amount); + uint64_t RawAmount() const { return raw_amount_; } private: @@ -78,4 +82,4 @@ class ReadCompressed { } // namespace util -#endif // UTIL_READ_COMPRESSED__ +#endif // UTIL_READ_COMPRESSED_H |