23 :_start(start),_pos(start),_end(start+s){};
26 inline void skip(
size_t s ){ _pos += s; }
27 inline bool read(
char* d,
size_t s ) {
28 if(
size_t(_end - _pos) >= (
size_t)s ) {
36 inline bool write(
const char* d,
size_t s ) {
37 if( _end - _pos >= (int32_t)s ) {
45 inline bool put(
char c) {
54 inline bool get(
unsigned char& c ) {
return get( *(
char*)&c ); }
55 inline bool get(
char& c )
65 T
pos()
const {
return _pos; }
66 inline bool valid()
const {
return _pos <= _end && _pos >= _start; }
67 inline bool seekp(
size_t p) { _pos = _start + p;
return _pos <= _end; }
68 inline size_t tellp()
const {
return _pos - _start; }
69 inline size_t remaining()
const {
return _end - _pos; }
80 inline bool skip(
size_t s ) { _size += s;
return true; }
81 inline bool write(
const char* ,
size_t s ) { _size += s;
return true; }
82 inline bool put(
char ) { ++_size;
return true; }
83 inline bool valid()
const {
return true; }
84 inline bool seekp(
size_t p) { _size = p;
return true; }
85 inline size_t tellp()
const {
return _size; }