7 #ifndef MEDIA_BASE_BUFFER_WRITER_H_
8 #define MEDIA_BASE_BUFFER_WRITER_H_
12 #include "packager/base/macros.h"
13 #include "packager/status.h"
49 void AppendVector(
const std::vector<uint8_t>& v);
50 void AppendArray(
const uint8_t* buf,
size_t size);
53 void Swap(
BufferWriter* buffer) { buf_.swap(buffer->buf_); }
54 void SwapBuffer(std::vector<uint8_t>* buffer) { buf_.swap(*buffer); }
56 void Clear() { buf_.clear(); }
57 size_t Size()
const {
return buf_.size(); }
59 const uint8_t*
Buffer()
const {
return buf_.data(); }
70 void AppendInternal(T v);
72 std::vector<uint8_t> buf_;
80 #endif // MEDIA_BASE_BUFFER_WRITER_H_