varint.h 818 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <util/stream/input.h>
  3. #include <util/stream/output.h>
  4. #include <util/system/defaults.h>
  5. namespace NYson {
  6. ////////////////////////////////////////////////////////////////////////////////
  7. // Various functions that read/write varints from/to a stream.
  8. // Returns the number of bytes written.
  9. int WriteVarUInt64(IOutputStream* output, ui64 value);
  10. int WriteVarInt32(IOutputStream* output, i32 value);
  11. int WriteVarInt64(IOutputStream* output, i64 value);
  12. // Returns the number of bytes read.
  13. int ReadVarUInt64(IInputStream* input, ui64* value);
  14. int ReadVarInt32(IInputStream* input, i32* value);
  15. int ReadVarInt64(IInputStream* input, i64* value);
  16. ////////////////////////////////////////////////////////////////////////////////
  17. } // namespace NYson