C++ Utilities  5.0.0
Useful C++ classes and routines such as argument parser, IO and conversion utilities
binaryreader.h
Go to the documentation of this file.
1 #ifndef IOUTILITIES_BINERYREADER_H
2 #define IOUTILITIES_BINERYREADER_H
3 
4 #include "../conversion/binaryconversion.h"
5 
6 #include <istream>
7 #include <string>
8 #include <vector>
9 
10 namespace CppUtilities {
12 
13 public:
14  BinaryReader(std::istream *stream, bool giveOwnership = false);
15  BinaryReader(const BinaryReader &other);
16  BinaryReader &operator=(const BinaryReader &rhs) = delete;
17  ~BinaryReader();
18 
19  const std::istream *stream() const;
20  std::istream *stream();
21  void setStream(std::istream *stream, bool giveOwnership = false);
22  bool hasOwnership() const;
23  void giveOwnership();
24  void detatchOwnership();
25  bool fail() const;
26  bool eof() const;
27  bool canRead() const;
28  std::istream::pos_type readStreamsize();
29  void read(char *buffer, std::streamsize length);
30  void read(std::uint8_t *buffer, std::streamsize length);
31  void read(std::vector<char> &buffer, std::streamsize length);
32  std::int16_t readInt16BE();
33  std::uint16_t readUInt16BE();
34  std::int32_t readInt24BE();
35  std::uint32_t readUInt24BE();
36  std::int32_t readInt32BE();
37  std::uint32_t readUInt32BE();
38  std::int64_t readInt40BE();
39  std::uint64_t readUInt40BE();
40  std::int64_t readInt56BE();
41  std::uint64_t readUInt56BE();
42  std::int64_t readInt64BE();
43  std::uint64_t readUInt64BE();
44  std::uint64_t readVariableLengthUIntBE();
45  float readFloat32BE();
46  double readFloat64BE();
47  std::int16_t readInt16LE();
48  std::uint16_t readUInt16LE();
49  std::int32_t readInt24LE();
50  std::uint32_t readUInt24LE();
51  std::int32_t readInt32LE();
52  std::uint32_t readUInt32LE();
53  std::int64_t readInt40LE();
54  std::uint64_t readUInt40LE();
55  std::int64_t readInt56LE();
56  std::uint64_t readUInt56LE();
57  std::int64_t readInt64LE();
58  std::uint64_t readUInt64LE();
59  std::uint64_t readVariableLengthUIntLE();
60  float readFloat32LE();
61  double readFloat64LE();
62  char readChar();
63  std::uint8_t readByte();
64  bool readBool();
65  std::string readLengthPrefixedString();
66  std::string readString(std::size_t length);
67  std::string readTerminatedString(std::uint8_t termination = 0);
68  std::string readTerminatedString(std::size_t maxBytesToRead, std::uint8_t termination = 0);
69  std::uint32_t readSynchsafeUInt32BE();
70  float readFixed8BE();
71  float readFixed16BE();
72  std::uint32_t readSynchsafeUInt32LE();
73  float readFixed8LE();
74  float readFixed16LE();
75  std::uint32_t readCrc32(std::size_t length);
76  static std::uint32_t computeCrc32(const char *buffer, std::size_t length);
77  static const std::uint32_t crc32Table[];
78 
79  // declare further overloads for read() to ease use of BinaryReader in templates
80  void read(char &oneCharacter);
81  void read(std::uint8_t &oneByte);
82  void read(bool &oneBool);
83  void read(std::string &lengthPrefixedString);
84  void read(std::int16_t &one16BitInt);
85  void read(std::uint16_t &one16BitUInt);
86  void read(std::int32_t &one32BitInt);
87  void read(std::uint32_t &one32BitUInt);
88  void read(std::int64_t &one64BitInt);
89  void read(std::uint64_t &one64BitUInt);
90  void read(float &one32BitFloat);
91  void read(double &one64BitFloat);
92 
93 private:
94  void bufferVariableLengthInteger();
95 
96  std::istream *m_stream;
97  bool m_ownership;
98  char m_buffer[8];
99 };
100 
106 inline BinaryReader::BinaryReader(std::istream *stream, bool giveOwnership)
107  : m_stream(stream)
108  , m_ownership(giveOwnership)
109 {
110 }
111 
117  : m_stream(other.m_stream)
118  , m_ownership(false)
119 {
120 }
121 
126 {
127  if (m_ownership) {
128  delete m_stream;
129  }
130 }
131 
137 inline std::istream *BinaryReader::stream()
138 {
139  return m_stream;
140 }
141 
147 inline const std::istream *BinaryReader::stream() const
148 {
149  return m_stream;
150 }
151 
159 inline bool BinaryReader::hasOwnership() const
160 {
161  return m_ownership;
162 }
163 
172 {
173  if (m_stream) {
174  m_ownership = true;
175  }
176 }
177 
186 {
187  m_ownership = false;
188 }
189 
193 inline bool BinaryReader::fail() const
194 {
195  return m_stream ? m_stream->fail() : false;
196 }
197 
201 inline bool BinaryReader::eof() const
202 {
203  return m_stream && m_stream->eof();
204 }
205 
209 inline bool BinaryReader::canRead() const
210 {
211  return m_stream && m_stream->good();
212 }
213 
217 inline void BinaryReader::read(char *buffer, std::streamsize length)
218 {
219  m_stream->read(buffer, length);
220 }
221 
225 inline void BinaryReader::read(std::uint8_t *buffer, std::streamsize length)
226 {
227  m_stream->read(reinterpret_cast<char *>(buffer), length);
228 }
229 
233 inline void BinaryReader::read(std::vector<char> &buffer, std::streamsize length)
234 {
235  buffer.resize(static_cast<std::vector<char>::size_type>(length));
236  m_stream->read(buffer.data(), length);
237 }
238 
242 inline std::int16_t BinaryReader::readInt16BE()
243 {
244  m_stream->read(m_buffer, sizeof(std::int16_t));
245  return BE::toInt16(m_buffer);
246 }
247 
251 inline std::uint16_t BinaryReader::readUInt16BE()
252 {
253  m_stream->read(m_buffer, sizeof(std::uint16_t));
254  return BE::toUInt16(m_buffer);
255 }
256 
260 inline std::int32_t BinaryReader::readInt24BE()
261 {
262  *m_buffer = 0;
263  m_stream->read(m_buffer + 1, 3);
264  auto val = BE::toInt32(m_buffer);
265  if (val >= 0x800000) {
266  val = -(0x1000000 - val);
267  }
268  return val;
269 }
270 
274 inline std::uint32_t BinaryReader::readUInt24BE()
275 {
276  *m_buffer = 0;
277  m_stream->read(m_buffer + 1, 3);
278  return BE::toUInt32(m_buffer);
279 }
280 
284 inline std::int32_t BinaryReader::readInt32BE()
285 {
286  m_stream->read(m_buffer, sizeof(std::int32_t));
287  return BE::toInt32(m_buffer);
288 }
289 
293 inline std::uint32_t BinaryReader::readUInt32BE()
294 {
295  m_stream->read(m_buffer, sizeof(std::uint32_t));
296  return BE::toUInt32(m_buffer);
297 }
298 
302 inline std::int64_t BinaryReader::readInt40BE()
303 {
304  *m_buffer = *(m_buffer + 1) = *(m_buffer + 2) = 0;
305  m_stream->read(m_buffer + 3, 5);
306  auto val = BE::toInt64(m_buffer);
307  if (val >= 0x8000000000) {
308  val = -(0x10000000000 - val);
309  }
310  return val;
311 }
312 
316 inline std::uint64_t BinaryReader::readUInt40BE()
317 {
318  *m_buffer = *(m_buffer + 1) = *(m_buffer + 2) = 0;
319  m_stream->read(m_buffer + 3, 5);
320  return BE::toUInt64(m_buffer);
321 }
322 
326 inline std::int64_t BinaryReader::readInt56BE()
327 {
328  *m_buffer = 0;
329  m_stream->read(m_buffer + 1, 7);
330  auto val = BE::toInt64(m_buffer);
331  if (val >= 0x80000000000000) {
332  val = -(0x100000000000000 - val);
333  }
334  return val;
335 }
336 
340 inline std::uint64_t BinaryReader::readUInt56BE()
341 {
342  *m_buffer = 0;
343  m_stream->read(m_buffer + 1, 7);
344  return BE::toUInt64(m_buffer);
345 }
346 
350 inline std::int64_t BinaryReader::readInt64BE()
351 {
352  m_stream->read(m_buffer, sizeof(std::int64_t));
353  return BE::toInt64(m_buffer);
354 }
355 
359 inline std::uint64_t BinaryReader::readUInt64BE()
360 {
361  m_stream->read(m_buffer, sizeof(std::uint64_t));
362  return BE::toUInt64(m_buffer);
363 }
364 
370 {
371  bufferVariableLengthInteger();
372  return BE::toUInt64(m_buffer);
373 }
374 
379 {
380  m_stream->read(m_buffer, sizeof(float));
381  return BE::toFloat32(m_buffer);
382 }
383 
388 {
389  m_stream->read(m_buffer, sizeof(double));
390  return BE::toFloat64(m_buffer);
391 }
392 
396 inline std::int16_t BinaryReader::readInt16LE()
397 {
398  m_stream->read(m_buffer, sizeof(std::int16_t));
399  return LE::toInt16(m_buffer);
400 }
401 
405 inline std::uint16_t BinaryReader::readUInt16LE()
406 {
407  m_stream->read(m_buffer, sizeof(std::uint16_t));
408  return LE::toUInt16(m_buffer);
409 }
410 
414 inline std::int32_t BinaryReader::readInt24LE()
415 {
416  *(m_buffer + 3) = 0;
417  m_stream->read(m_buffer, 3);
418  auto val = LE::toInt32(m_buffer);
419  if (val >= 0x800000) {
420  val = -(0x1000000 - val);
421  }
422  return val;
423 }
424 
428 inline std::uint32_t BinaryReader::readUInt24LE()
429 {
430  *(m_buffer + 3) = 0;
431  m_stream->read(m_buffer, 3);
432  return LE::toUInt32(m_buffer);
433 }
434 
438 inline std::int32_t BinaryReader::readInt32LE()
439 {
440  m_stream->read(m_buffer, sizeof(std::int32_t));
441  return LE::toInt32(m_buffer);
442 }
443 
447 inline std::uint32_t BinaryReader::readUInt32LE()
448 {
449  m_stream->read(m_buffer, sizeof(std::uint32_t));
450  return LE::toUInt32(m_buffer);
451 }
452 
456 inline std::int64_t BinaryReader::readInt40LE()
457 {
458  *(m_buffer + 5) = *(m_buffer + 6) = *(m_buffer + 7) = 0;
459  m_stream->read(m_buffer, 5);
460  auto val = LE::toInt64(m_buffer);
461  if (val >= 0x8000000000) {
462  val = -(0x10000000000 - val);
463  }
464  return val;
465 }
466 
470 inline std::uint64_t BinaryReader::readUInt40LE()
471 {
472  *(m_buffer + 5) = *(m_buffer + 6) = *(m_buffer + 7) = 0;
473  m_stream->read(m_buffer, 5);
474  return LE::toUInt64(m_buffer);
475 }
476 
480 inline std::int64_t BinaryReader::readInt56LE()
481 {
482  *(m_buffer + 7) = 0;
483  m_stream->read(m_buffer, 7);
484  auto val = LE::toInt64(m_buffer);
485  if (val >= 0x80000000000000) {
486  val = -(0x100000000000000 - val);
487  }
488  return val;
489 }
490 
494 inline std::uint64_t BinaryReader::readUInt56LE()
495 {
496  *(m_buffer + 7) = 0;
497  m_stream->read(m_buffer, 7);
498  return LE::toUInt64(m_buffer);
499 }
500 
504 inline std::int64_t BinaryReader::readInt64LE()
505 {
506  m_stream->read(m_buffer, sizeof(std::int64_t));
507  return LE::toInt64(m_buffer);
508 }
509 
513 inline std::uint64_t BinaryReader::readUInt64LE()
514 {
515  m_stream->read(m_buffer, sizeof(std::uint64_t));
516  return LE::toUInt64(m_buffer);
517 }
518 
524 {
525  bufferVariableLengthInteger();
526  return LE::toUInt64(m_buffer);
527 }
528 
533 {
534  m_stream->read(m_buffer, sizeof(float));
535  return LE::toFloat32(m_buffer);
536 }
537 
542 {
543  m_stream->read(m_buffer, sizeof(double));
544  return LE::toFloat64(m_buffer);
545 }
546 
551 {
552  m_stream->read(m_buffer, sizeof(char));
553  return m_buffer[0];
554 }
555 
559 inline uint8_t BinaryReader::readByte()
560 {
561  m_stream->read(m_buffer, sizeof(char));
562  return static_cast<std::uint8_t>(m_buffer[0]);
563 }
564 
570 {
571  return readByte() != 0;
572 }
573 
580 {
582 }
583 
590 {
591  return toNormalInt(readUInt32BE());
592 }
593 
598 {
599  return toFloat32(readUInt16BE());
600 }
601 
606 {
607  return toFloat32(readUInt32BE());
608 }
609 
616 {
617  return toNormalInt(readUInt32LE());
618 }
619 
624 {
625  return toFloat32(readUInt16LE());
626 }
627 
632 {
633  return toFloat32(readUInt32LE());
634 }
635 
639 inline void BinaryReader::read(char &oneCharacter)
640 {
641  oneCharacter = readChar();
642 }
643 
647 inline void BinaryReader::read(std::uint8_t &oneByte)
648 {
649  oneByte = readByte();
650 }
651 
656 inline void BinaryReader::read(bool &oneBool)
657 {
658  oneBool = readBool();
659 }
660 
667 inline void BinaryReader::read(std::string &lengthPrefixedString)
668 {
669  lengthPrefixedString = readLengthPrefixedString();
670 }
671 
675 inline void BinaryReader::read(std::int16_t &one16BitInt)
676 {
677  one16BitInt = readInt16BE();
678 }
679 
683 inline void BinaryReader::read(std::uint16_t &one16BitUInt)
684 {
685  one16BitUInt = readUInt16BE();
686 }
687 
691 inline void BinaryReader::read(std::int32_t &one32BitInt)
692 {
693  one32BitInt = readInt32BE();
694 }
695 
699 inline void BinaryReader::read(std::uint32_t &one32BitUInt)
700 {
701  one32BitUInt = readUInt32BE();
702 }
703 
707 inline void BinaryReader::read(std::int64_t &one64BitInt)
708 {
709  one64BitInt = readInt64BE();
710 }
711 
715 inline void BinaryReader::read(std::uint64_t &one64BitUInt)
716 {
717  one64BitUInt = readUInt64BE();
718 }
719 
723 inline void BinaryReader::read(float &one32BitFloat)
724 {
725  one32BitFloat = readFloat32BE();
726 }
727 
731 inline void BinaryReader::read(double &one64BitFloat)
732 {
733  one64BitFloat = readFloat64BE();
734 }
735 } // namespace CppUtilities
736 
737 #endif // IOUTILITIES_BINERYREADER_H
CppUtilities::BinaryReader::readFixed8LE
float readFixed8LE()
Reads a 8.8 fixed point little endian representation from the current stream and returns it as 32-bit...
Definition: binaryreader.h:623
CppUtilities::BinaryReader::detatchOwnership
void detatchOwnership()
The reader will not take ownership over the assigned stream.
Definition: binaryreader.h:185
CppUtilities::BinaryReader::readUInt40LE
std::uint64_t readUInt40LE()
Reads a 40-bit little endian unsigned integer from the current stream and advances the current positi...
Definition: binaryreader.h:470
CppUtilities::BinaryReader::~BinaryReader
~BinaryReader()
Destroys the BinaryReader.
Definition: binaryreader.h:125
CppUtilities::BinaryReader::canRead
bool canRead() const
Returns an indication whether a stream is assigned the reader can read from.
Definition: binaryreader.h:209
CppUtilities::BinaryReader::readInt24LE
std::int32_t readInt24LE()
Reads a 24-bit little endian signed integer from the current stream and advances the current position...
Definition: binaryreader.h:414
CppUtilities::BinaryReader::readInt56BE
std::int64_t readInt56BE()
Reads a 56-bit big endian signed integer from the current stream and advances the current position of...
Definition: binaryreader.h:326
CppUtilities::BinaryReader::readByte
std::uint8_t readByte()
Reads a single byte/unsigned character from the current stream and advances the current position of t...
Definition: binaryreader.h:559
CppUtilities::BinaryReader::readFloat64LE
double readFloat64LE()
Reads a 64-bit little endian floating point value from the current stream and advances the current po...
Definition: binaryreader.h:541
CppUtilities::BinaryReader::readInt64LE
std::int64_t readInt64LE()
Reads a 64-bit little endian signed integer from the current stream and advances the current position...
Definition: binaryreader.h:504
CppUtilities::BinaryReader::readFixed16BE
float readFixed16BE()
Reads a 16.16 fixed point big endian representation from the current stream and returns it as 32-bit ...
Definition: binaryreader.h:605
CppUtilities::BinaryReader::readInt32LE
std::int32_t readInt32LE()
Reads a 32-bit little endian signed integer from the current stream and advances the current position...
Definition: binaryreader.h:438
CppUtilities::BinaryReader::readFixed8BE
float readFixed8BE()
Reads a 8.8 fixed point big endian representation from the current stream and returns it as 32-bit fl...
Definition: binaryreader.h:597
CppUtilities::BinaryReader::readVariableLengthUIntBE
std::uint64_t readVariableLengthUIntBE()
Reads an up to 8 byte long big endian unsigned integer from the current stream and advances the curre...
Definition: binaryreader.h:369
CppUtilities::BinaryReader::readBool
bool readBool()
Reads a boolean value from the current stream and advances the current position of the stream by one ...
Definition: binaryreader.h:569
CppUtilities::BinaryReader::readInt16BE
std::int16_t readInt16BE()
Reads a 16-bit big endian signed integer from the current stream and advances the current position of...
Definition: binaryreader.h:242
CppUtilities::BinaryReader::readChar
char readChar()
Reads a single character from the current stream and advances the current position of the stream by o...
Definition: binaryreader.h:550
CppUtilities::BinaryReader::hasOwnership
bool hasOwnership() const
Returns whether the reader takes ownership over the assigned stream.
Definition: binaryreader.h:159
CppUtilities::BinaryReader::readUInt32BE
std::uint32_t readUInt32BE()
Reads a 32-bit big endian unsigned integer from the current stream and advances the current position ...
Definition: binaryreader.h:293
CppUtilities::BinaryReader::giveOwnership
void giveOwnership()
The reader will take ownership over the assigned stream.
Definition: binaryreader.h:171
CppUtilities::BinaryReader::readFloat32LE
float readFloat32LE()
Reads a 32-bit little endian floating point value from the current stream and advances the current po...
Definition: binaryreader.h:532
CppUtilities::toNormalInt
constexpr CPP_UTILITIES_EXPORT std::uint32_t toNormalInt(std::uint32_t synchsafeInt)
Returns a normal 32-bit integer converted from a 32-bit synchsafe integer.
Definition: binaryconversion.h:145
CppUtilities::BinaryReader::readUInt24BE
std::uint32_t readUInt24BE()
Reads a 24-bit big endian unsigned integer from the current stream and advances the current position ...
Definition: binaryreader.h:274
CppUtilities::BinaryReader::readInt40LE
std::int64_t readInt40LE()
Reads a 40-bit little endian signed integer from the current stream and advances the current position...
Definition: binaryreader.h:456
CppUtilities::BinaryReader::stream
const std::istream * stream() const
Returns a pointer to the stream the reader will read from when calling one of the read-methods.
Definition: binaryreader.h:147
CppUtilities::BinaryReader::readInt64BE
std::int64_t readInt64BE()
Reads a 64-bit big endian signed integer from the current stream and advances the current position of...
Definition: binaryreader.h:350
CppUtilities::BinaryReader::eof
bool eof() const
Returns an indication whether the end-of-stream bit of the assigned stream is set.
Definition: binaryreader.h:201
CppUtilities::BinaryReader::readInt56LE
std::int64_t readInt56LE()
Reads a 56-bit little endian signed integer from the current stream and advances the current position...
Definition: binaryreader.h:480
CppUtilities::BinaryReader::readFixed16LE
float readFixed16LE()
Reads a 16.16 fixed point little endian representation from the current stream and returns it as 32-b...
Definition: binaryreader.h:631
CppUtilities::BinaryReader::BinaryReader
BinaryReader(std::istream *stream, bool giveOwnership=false)
Constructs a new BinaryReader.
Definition: binaryreader.h:106
CppUtilities::BinaryReader::read
void read(char *buffer, std::streamsize length)
Reads the specified number of characters from the stream in the character array.
Definition: binaryreader.h:217
CppUtilities::BinaryReader::readUInt16BE
std::uint16_t readUInt16BE()
Reads a 16-bit big endian unsigned integer from the current stream and advances the current position ...
Definition: binaryreader.h:251
CppUtilities::BinaryReader::readFloat32BE
float readFloat32BE()
Reads a 32-bit big endian floating point value from the current stream and advances the current posit...
Definition: binaryreader.h:378
CppUtilities
Contains all utilities provides by the c++utilities library.
Definition: argumentparser.h:17
CppUtilities::BinaryReader::readUInt32LE
std::uint32_t readUInt32LE()
Reads a 32-bit little endian unsigned integer from the current stream and advances the current positi...
Definition: binaryreader.h:447
CppUtilities::BinaryReader::readUInt24LE
std::uint32_t readUInt24LE()
Reads a 24-bit little endian unsigned integer from the current stream and advances the current positi...
Definition: binaryreader.h:428
CppUtilities::BinaryReader::readUInt56LE
std::uint64_t readUInt56LE()
Reads a 56-bit little endian unsigned integer from the current stream and advances the current positi...
Definition: binaryreader.h:494
CppUtilities::BinaryReader::readUInt64LE
std::uint64_t readUInt64LE()
Reads a 64-bit little endian unsigned integer from the current stream and advances the current positi...
Definition: binaryreader.h:513
CppUtilities::BinaryReader::fail
bool fail() const
Returns an indication whether the fail bit of the assigned stream is set.
Definition: binaryreader.h:193
CppUtilities::BinaryReader::readSynchsafeUInt32BE
std::uint32_t readSynchsafeUInt32BE()
Reads a 32-bit big endian synchsafe integer from the current stream and advances the current position...
Definition: binaryreader.h:589
CppUtilities::BinaryReader::readUInt64BE
std::uint64_t readUInt64BE()
Reads a 64-bit big endian unsigned integer from the current stream and advances the current position ...
Definition: binaryreader.h:359
CppUtilities::BinaryReader::readInt40BE
std::int64_t readInt40BE()
Reads a 40-bit big endian signed integer from the current stream and advances the current position of...
Definition: binaryreader.h:302
CppUtilities::BinaryReader::readUInt56BE
std::uint64_t readUInt56BE()
Reads a 56-bit big endian unsigned integer from the current stream and advances the current position ...
Definition: binaryreader.h:340
CppUtilities::BinaryReader::readUInt40BE
std::uint64_t readUInt40BE()
Reads a 40-bit big endian unsigned integer from the current stream and advances the current position ...
Definition: binaryreader.h:316
CppUtilities::BinaryReader
Reads primitive data types from a std::istream.
Definition: binaryreader.h:11
CppUtilities::toFloat32
constexpr CPP_UTILITIES_EXPORT float toFloat32(std::uint16_t fixed8value)
Returns a 32-bit floating point number converted from the specified 8.8 fixed point representation.
Definition: binaryconversion.h:109
CppUtilities::BinaryReader::readString
std::string readString(std::size_t length)
Reads a string from the current stream of the given length from the stream and advances the current p...
Definition: binaryreader.cpp:82
CppUtilities::BinaryReader::readUInt16LE
std::uint16_t readUInt16LE()
Reads a 16-bit little endian unsigned integer from the current stream and advances the current positi...
Definition: binaryreader.h:405
CPP_UTILITIES_EXPORT
#define CPP_UTILITIES_EXPORT
Marks the symbol to be exported by the c++utilities library.
CppUtilities::BinaryReader::readFloat64BE
double readFloat64BE()
Reads a 64-bit big endian floating point value from the current stream and advances the current posit...
Definition: binaryreader.h:387
CppUtilities::BinaryReader::readVariableLengthUIntLE
std::uint64_t readVariableLengthUIntLE()
Reads an up to 8 byte long little endian unsigned integer from the current stream and advances the cu...
Definition: binaryreader.h:523
CppUtilities::BinaryReader::readInt24BE
std::int32_t readInt24BE()
Reads a 24-bit big endian signed integer from the current stream and advances the current position of...
Definition: binaryreader.h:260
CppUtilities::BinaryReader::readSynchsafeUInt32LE
std::uint32_t readSynchsafeUInt32LE()
Reads a 32-bit little endian synchsafe integer from the current stream and advances the current posit...
Definition: binaryreader.h:615
CppUtilities::BinaryReader::readInt32BE
std::int32_t readInt32BE()
Reads a 32-bit big endian signed integer from the current stream and advances the current position of...
Definition: binaryreader.h:284
CppUtilities::BinaryReader::readInt16LE
std::int16_t readInt16LE()
Reads a 16-bit little endian signed integer from the current stream and advances the current position...
Definition: binaryreader.h:396
CppUtilities::BinaryReader::readLengthPrefixedString
std::string readLengthPrefixedString()
Reads a length prefixed string from the current stream.
Definition: binaryreader.h:579