Buffer input stream.
More...
#include <gf/Streams.h>
◆ BufferInputStream()
gf::BufferInputStream::BufferInputStream |
( |
std::vector< uint8_t > * |
bytes | ) |
|
Constructor.
- Parameters
-
bytes | The supplied external bytes to be read |
◆ getBytes()
std::vector< uint8_t > * gf::BufferInputStream::getBytes |
( |
| ) |
|
|
inline |
Get the underlying bytes.
◆ isFinished()
virtual bool gf::BufferInputStream::isFinished |
( |
| ) |
|
|
overridevirtual |
Tell if the stream is at the end.
- Returns
- A boolean indicating the end of the stream
Implements gf::InputStream.
◆ read()
virtual std::size_t gf::BufferInputStream::read |
( |
Span< uint8_t > |
buffer | ) |
|
|
overridevirtual |
Read data from the stream.
After reading, the stream's reading position must be advanced by the amount of bytes read.
- Parameters
-
buffer | The buffer where to copy the read data |
- Returns
- The number of bytes actually read
Implements gf::InputStream.
◆ seek()
virtual void gf::BufferInputStream::seek |
( |
std::ptrdiff_t |
position | ) |
|
|
overridevirtual |
Change the current reading position.
- Parameters
-
position | The position to seek to, from the beginning |
Implements gf::InputStream.
◆ skip()
virtual void gf::BufferInputStream::skip |
( |
std::ptrdiff_t |
position | ) |
|
|
overridevirtual |
Change the current reading position.
- Parameters
-
position | The position to seek to, from the current position |
Implements gf::InputStream.