|
|
|
|
|
|
|
|
// |
|
|
// |
|
|
size_t Stream::readBytes(char *buffer, size_t length) |
|
|
size_t Stream::readBytes(char *buffer, size_t length) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (buffer == nullptr) return 0; |
|
|
size_t count = 0; |
|
|
size_t count = 0; |
|
|
while (count < length) { |
|
|
while (count < length) { |
|
|
int c = timedRead(); |
|
|
int c = timedRead(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_t Stream::readBytesUntil(char terminator, char *buffer, size_t length) |
|
|
size_t Stream::readBytesUntil(char terminator, char *buffer, size_t length) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (buffer == nullptr) return 0; |
|
|
if (length < 1) return 0; |
|
|
if (length < 1) return 0; |
|
|
length--; |
|
|
length--; |
|
|
size_t index = 0; |
|
|
size_t index = 0; |