Shaka Packager SDK
|
#include <buffer_reader.h>
Public Member Functions | |
BufferReader (const uint8_t *buf, size_t size) | |
Create a BufferReader from a raw buffer. | |
bool | HasBytes (size_t count) |
bool | ReadToVector (std::vector< uint8_t > *t, size_t count) WARN_UNUSED_RESULT |
bool | ReadToString (std::string *str, size_t size) WARN_UNUSED_RESULT |
bool | SkipBytes (size_t num_bytes) WARN_UNUSED_RESULT |
const uint8_t * | data () const |
size_t | size () const |
void | set_size (size_t size) |
size_t | pos () const |
bool | Read1 (uint8_t *v) WARN_UNUSED_RESULT |
bool | Read2 (uint16_t *v) WARN_UNUSED_RESULT |
bool | Read2s (int16_t *v) WARN_UNUSED_RESULT |
bool | Read4 (uint32_t *v) WARN_UNUSED_RESULT |
bool | Read4s (int32_t *v) WARN_UNUSED_RESULT |
bool | Read8 (uint64_t *v) WARN_UNUSED_RESULT |
bool | Read8s (int64_t *v) WARN_UNUSED_RESULT |
bool | ReadNBytesInto8 (uint64_t *v, size_t num_bytes) WARN_UNUSED_RESULT |
bool | ReadNBytesInto8s (int64_t *v, size_t num_bytes) WARN_UNUSED_RESULT |
A simple buffer reader implementation, which reads data of various types from a fixed byte array.
Definition at line 23 of file buffer_reader.h.
|
inline |
Definition at line 32 of file buffer_reader.h.
bool shaka::media::BufferReader::Read1 | ( | uint8_t * | v | ) |
Read a value from the stream, performing endian correction, and advance the stream pointer.
Definition at line 14 of file buffer_reader.cc.
bool shaka::media::BufferReader::ReadNBytesInto8 | ( | uint64_t * | v, |
size_t | num_bytes | ||
) |
Read N-byte integer of the corresponding signedness and store it in the 8-byte return type.
num_bytes | should not be larger than 8 bytes. |
Definition at line 40 of file buffer_reader.cc.
bool shaka::media::BufferReader::SkipBytes | ( | size_t | num_bytes | ) |
Advance the stream by this many bytes.
Definition at line 65 of file buffer_reader.cc.