43 bool Reading()
const {
return reader_ != NULL; }
49 return reader_->pos();
50 return writer_->Size();
59 return reader_->size();
60 return writer_->Size();
67 return reader_->size() - reader_->pos();
73 bool ReadWriteUInt8(uint8_t* v) {
75 return reader_->
Read1(v);
79 bool ReadWriteUInt16(uint16_t* v) {
81 return reader_->Read2(v);
85 bool ReadWriteUInt32(uint32_t* v) {
87 return reader_->Read4(v);
91 bool ReadWriteUInt64(uint64_t* v) {
93 return reader_->Read8(v);
97 bool ReadWriteInt16(int16_t* v) {
99 return reader_->Read2s(v);
103 bool ReadWriteInt32(int32_t* v) {
105 return reader_->Read4s(v);
109 bool ReadWriteInt64(int64_t* v) {
111 return reader_->Read8s(v);
126 bool ReadWriteInt64NBytes(int64_t* v,
size_t num_bytes) {
128 return reader_->ReadNBytesInto8s(v, num_bytes);
132 bool ReadWriteVector(std::vector<uint8_t>* vector,
size_t count) {
134 return reader_->ReadToVector(vector, count);
135 DCHECK_EQ(vector->size(), count);
136 writer_->AppendArray(vector->data(), count);
144 return reader_->ReadToString(str, size);
145 DCHECK_EQ(str->size(), size);
146 writer_->AppendArray(
reinterpret_cast<const uint8_t*
>(str->data()),
151 bool ReadWriteCString(std::string* str) {
155 DCHECK_EQ(str->find(
'\0'), std::string::npos);
156 writer_->AppendString(*str);
157 writer_->
AppendInt(
static_cast<uint8_t
>(
'\0'));
161 bool ReadWriteFourCC(FourCC* fourcc) {
163 return reader_->ReadFourCC(fourcc);
164 writer_->
AppendInt(
static_cast<uint32_t
>(*fourcc));
184 CHECK(box->ReadWriteInternal(
this));
195 CHECK(box->ReadWriteInternal(
this));
205 std::vector<uint8_t> vector(num_bytes, 0);
206 writer_->AppendVector(vector);