46 bool Reading()
const {
return reader_ != NULL; }
52 return reader_->pos();
53 return writer_->Size();
62 return reader_->size();
63 return writer_->Size();
70 return reader_->size() - reader_->pos();
76 bool ReadWriteUInt8(uint8_t* v) {
78 return reader_->
Read1(v);
82 bool ReadWriteUInt16(uint16_t* v) {
84 return reader_->Read2(v);
88 bool ReadWriteUInt32(uint32_t* v) {
90 return reader_->Read4(v);
94 bool ReadWriteUInt64(uint64_t* v) {
96 return reader_->Read8(v);
100 bool ReadWriteInt16(int16_t* v) {
102 return reader_->Read2s(v);
106 bool ReadWriteInt32(int32_t* v) {
108 return reader_->Read4s(v);
112 bool ReadWriteInt64(int64_t* v) {
114 return reader_->Read8s(v);
129 bool ReadWriteInt64NBytes(int64_t* v,
size_t num_bytes) {
131 return reader_->ReadNBytesInto8s(v, num_bytes);
135 bool ReadWriteVector(std::vector<uint8_t>* vector,
size_t count) {
137 return reader_->ReadToVector(vector, count);
138 DCHECK_EQ(vector->size(), count);
139 writer_->AppendArray(vector->data(), count);
147 return reader_->ReadToString(str, size);
148 DCHECK_EQ(str->size(), size);
149 writer_->AppendArray(
reinterpret_cast<const uint8_t*
>(str->data()),
154 bool ReadWriteCString(std::string* str) {
158 DCHECK_EQ(str->find(
'\0'), std::string::npos);
159 writer_->AppendString(*str);
160 writer_->
AppendInt(
static_cast<uint8_t
>(
'\0'));
164 bool ReadWriteFourCC(FourCC* fourcc) {
166 return reader_->ReadFourCC(fourcc);
167 writer_->
AppendInt(
static_cast<uint32_t
>(*fourcc));
187 CHECK(box->ReadWriteInternal(
this));
198 CHECK(box->ReadWriteInternal(
this));
208 std::vector<uint8_t> vector(num_bytes, 0);
209 writer_->AppendVector(vector);