stream::Reader for a bytes (or string) field in a streamed proto message.
Shares the StreamDecoder's reader, limiting it to the bounds of the field. If the StreamDecoder's reader does not support seeking, BytesReader will also not support seeking.
- Warning
- When a
BytesReader is active, any use of the parent StreamDecoder that created it will trigger a crash. To resume using the parent decoder, destroy the BytesReader first.
|
|
constexpr size_t | field_size () const |
| |
| constexpr bool | readable () const |
| |
| constexpr bool | writable () const |
| |
| constexpr bool | seekable () const |
| |
|
constexpr bool | seekable (Whence origin) const |
| | True if the stream supports seeking from the specified origin.
|
| |
| Result< ByteSpan > | Read (ByteSpan dest) |
| |
|
Result< ByteSpan > | Read (void *dest, size_t size_bytes) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
| Result< ByteSpan > | ReadExact (ByteSpan const buffer) |
| |
| Status | Write (ConstByteSpan data) |
| |
|
Status | Write (const void *data, size_t size_bytes) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
|
Status | Write (const std::byte b) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
| |
| Status | Seek (ptrdiff_t offset, Whence origin=kBeginning) |
| |
| size_t | Tell () |
| |
| size_t | ConservativeReadLimit () const |
| |
| size_t | ConservativeWriteLimit () const |
| |