rename to mimic pbuf api

This commit is contained in:
Kevin Matz 2021-01-08 02:25:49 -05:00
parent 796b8a5993
commit a678676d3d
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ Pdu::Pdu(stream_ptr stream, size_t vector_size)
}
// create a stream buffer for the header and data
buffer_ = stream_ptr(new pdu_stream(stream->cur_ptr(), len));
buffer_ = stream_ptr(new pdu_stream(stream->data(), len));
if (buffer_->available() != len) {
stream->setstate(stream->rdstate() | std::ios_base::failbit);
return;

View File

@ -75,7 +75,7 @@ public:
: std::basic_istream<uint8_t>(&_buffer)
, _buffer(p, l) { rdbuf(&_buffer); }
std::streamsize available() { return _buffer.in_avail(); }
uint8_t * cur_ptr() { return _buffer.cur_ptr(); };
uint8_t * data() { return _buffer.cur_ptr(); };
uint8_t read8 ();
uint16_t read16();
uint32_t read32();