23 #include <libopenraw/types.h>
26 #include "endianutils.h"
28 #include "rawcontainer.h"
32 using namespace Debug;
38 RawContainer::RawContainer(
IO::Stream *_file, off_t offset)
54 bool RawContainer::readInt8(
IO::Stream *f, int8_t & v)
57 int s = f->
read(&buf, 1);
65 bool RawContainer::readUInt8(IO::Stream *f, uint8_t & v)
68 int s = f->read(&buf, 1);
79 if (m_endian == ENDIAN_NULL) {
81 Trace(ERROR) <<
"null endian\n";
86 int s = f->
read(buf, 2);
103 if (m_endian == ENDIAN_NULL) {
105 Trace(ERROR) <<
"null endian\n";
109 unsigned char buf[4];
110 int s = f->
read(buf, 4);
112 Trace(ERROR) <<
"read " << s <<
" bytes\n";
130 if (m_endian == ENDIAN_NULL) {
132 Trace(ERROR) <<
"null endian\n";
136 unsigned char buf[2];
137 int s = f->
read(buf, 2);
154 if (m_endian == ENDIAN_NULL) {
156 Trace(ERROR) <<
"null endian\n";
160 unsigned char buf[4];
161 int s = f->
read(buf, 4);
179 const size_t buf_size)