#include <buffer_reader.h>
A simple buffer reader implementation, which reads data of various types from a fixed byte array.
Definition at line 21 of file buffer_reader.h.
◆ BufferReader()
| shaka::media::BufferReader::BufferReader |
( |
const uint8_t * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inline |
◆ ~BufferReader()
| shaka::media::BufferReader::~BufferReader |
( |
| ) |
|
|
inline |
◆ data()
| const uint8_t * shaka::media::BufferReader::data |
( |
| ) |
const |
|
inline |
◆ HasBytes()
| bool shaka::media::BufferReader::HasBytes |
( |
size_t |
count | ) |
|
|
inline |
- Returns
- true if there are more than count bytes in the stream, false otherwise.
Definition at line 30 of file buffer_reader.h.
◆ pos()
| size_t shaka::media::BufferReader::pos |
( |
| ) |
const |
|
inline |
◆ Read1()
| bool shaka::media::BufferReader::Read1 |
( |
uint8_t * |
v | ) |
|
Read a value from the stream, performing endian correction, and advance the stream pointer.
- Returns
- false if there are not enough bytes in the buffer.
Definition at line 15 of file buffer_reader.cc.
◆ Read2()
| bool shaka::media::BufferReader::Read2 |
( |
uint16_t * |
v | ) |
|
◆ Read2s()
| bool shaka::media::BufferReader::Read2s |
( |
int16_t * |
v | ) |
|
◆ Read4()
| bool shaka::media::BufferReader::Read4 |
( |
uint32_t * |
v | ) |
|
◆ Read4s()
| bool shaka::media::BufferReader::Read4s |
( |
int32_t * |
v | ) |
|
◆ Read8()
| bool shaka::media::BufferReader::Read8 |
( |
uint64_t * |
v | ) |
|
◆ Read8s()
| bool shaka::media::BufferReader::Read8s |
( |
int64_t * |
v | ) |
|
◆ ReadCString()
| bool shaka::media::BufferReader::ReadCString |
( |
std::string * |
str | ) |
|
◆ ReadNBytesInto8()
| 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.
- Parameters
-
| num_bytes | should not be larger than 8 bytes. |
- Returns
- false if there are not enough bytes in the buffer, true otherwise.
Definition at line 41 of file buffer_reader.cc.
◆ ReadNBytesInto8s()
| bool shaka::media::BufferReader::ReadNBytesInto8s |
( |
int64_t * |
v, |
|
|
size_t |
num_bytes |
|
) |
| |
◆ ReadToString()
| bool shaka::media::BufferReader::ReadToString |
( |
std::string * |
str, |
|
|
size_t |
size |
|
) |
| |
◆ ReadToVector()
| bool shaka::media::BufferReader::ReadToVector |
( |
std::vector< uint8_t > * |
t, |
|
|
size_t |
count |
|
) |
| |
◆ set_size()
| void shaka::media::BufferReader::set_size |
( |
size_t |
size | ) |
|
|
inline |
◆ size()
| size_t shaka::media::BufferReader::size |
( |
| ) |
const |
|
inline |
◆ SkipBytes()
| bool shaka::media::BufferReader::SkipBytes |
( |
size_t |
num_bytes | ) |
|
Advance the stream by this many bytes.
- Returns
- false if there are not enough bytes in the buffer, true otherwise.
Definition at line 78 of file buffer_reader.cc.
The documentation for this class was generated from the following files: