DASH Media Packaging SDK
|
#include <buffer_writer.h>
Public Member Functions | |
BufferWriter (size_t reserved_size_in_bytes) | |
void | AppendNBytes (uint64_t v, size_t num_bytes) |
void | AppendVector (const std::vector< uint8_t > &v) |
void | AppendArray (const uint8_t *buf, size_t size) |
void | AppendBuffer (const BufferWriter &buffer) |
void | Swap (BufferWriter *buffer) |
void | SwapBuffer (std::vector< uint8_t > *buffer) |
void | Clear () |
size_t | Size () const |
const uint8_t * | Buffer () const |
Status | WriteToFile (File *file) |
void | AppendInt (uint8_t v) |
void | AppendInt (uint16_t v) |
void | AppendInt (uint32_t v) |
void | AppendInt (uint64_t v) |
void | AppendInt (int16_t v) |
void | AppendInt (int32_t v) |
void | AppendInt (int64_t v) |
A simple buffer writer implementation which appends various data types to buffer.
Definition at line 22 of file buffer_writer.h.
|
explicit |
Construct the object with a reserved capacity.
reserved_size_in_bytes | is intended for optimization and is not a hard limit. It does not affect the actual size of the buffer, which still starts from zero. |
Definition at line 20 of file buffer_writer.cc.
void shaka::media::BufferWriter::AppendInt | ( | uint8_t | v | ) |
These convenience functions append the integers (in network byte order, i.e. big endian) of various size and signedness to the end of the buffer.
Definition at line 25 of file buffer_writer.cc.
void shaka::media::BufferWriter::AppendNBytes | ( | uint64_t | v, |
size_t | num_bytes | ||
) |
Append the least significant num_bytes of v to buffer.
num_bytes | should not be larger than sizeof(v), i.e. 8 on a 64-bit system. |
Definition at line 47 of file buffer_writer.cc.
|
inline |
Definition at line 59 of file buffer_writer.h.
Write the buffer to file. The internal buffer will be cleared after writing.
file | should not be NULL. |
Definition at line 66 of file buffer_writer.cc.