virtual int available() { | virtual int available() { | ||||
return (f) ? f->available() : 0; | return (f) ? f->available() : 0; | ||||
} | } | ||||
virtual int read() { | |||||
return (f) ? f->read() : -1; | |||||
} | |||||
virtual int peek() { | virtual int peek() { | ||||
return (f) ? f->peek() : -1; | return (f) ? f->peek() : -1; | ||||
} | } | ||||
bool seek(uint32_t pos) { | bool seek(uint32_t pos) { | ||||
return seek(pos, SeekSet); | return seek(pos, SeekSet); | ||||
} | } | ||||
int read() { | |||||
if (!f) return -1; | |||||
unsigned char b; | |||||
if (f->read(&b, 1) < 1) return -1; | |||||
return b; | |||||
} | |||||
size_t write(uint8_t b) { | size_t write(uint8_t b) { | ||||
return write(&b, 1); | return write(&b, 1); | ||||
} | } |
virtual int available() { | virtual int available() { | ||||
return (f) ? f->available() : 0; | return (f) ? f->available() : 0; | ||||
} | } | ||||
virtual int read() { | |||||
return (f) ? f->read() : -1; | |||||
} | |||||
virtual int peek() { | virtual int peek() { | ||||
return (f) ? f->peek() : -1; | return (f) ? f->peek() : -1; | ||||
} | } | ||||
bool seek(uint32_t pos) { | bool seek(uint32_t pos) { | ||||
return seek(pos, SeekSet); | return seek(pos, SeekSet); | ||||
} | } | ||||
int read() { | |||||
if (!f) return -1; | |||||
unsigned char b; | |||||
if (f->read(&b, 1) < 1) return -1; | |||||
return b; | |||||
} | |||||
size_t write(uint8_t b) { | size_t write(uint8_t b) { | ||||
return write(&b, 1); | return write(&b, 1); | ||||
} | } |