#include <elm/io/BlockInStream.h>
Input stream from a memory block.
◆ BlockInStream() [1/4]
Build a new memory block input stream.
- Parameters
-
block | Block to read from. |
size | Block size. |
◆ BlockInStream() [2/4]
Build a block input stream from a C string.
- Parameters
-
References elm::str().
◆ BlockInStream() [3/4]
Build a block input stream from a CString object.
- Parameters
-
◆ BlockInStream() [4/4]
Build a block input stream from a String object.
- Parameters
-
◆ block()
Get the current memory block.
- Returns
- Memory block.
◆ mark()
◆ move()
Move the read position to the given mark.
- Parameters
-
mark | Position mark to move to. |
References BlockInStream::mark().
◆ moveBackward()
void moveBackward |
( |
int |
size | ) |
|
|
inline |
Move backward in the stream.
- Parameters
-
size | Count of bytes to move backward to. |
References BlockInStream::size().
◆ moveForward()
void moveForward |
( |
int |
size | ) |
|
|
inline |
Move forward in the stream.
- Parameters
-
size | Count of bytes to move forward to. |
References BlockInStream::size().
◆ read() [1/2]
Read one byte from the stream.
- Returns
- Read byte, FAILED for an error, ENDED for end of stream.
Reimplemented from InStream.
References InStream::ENDED.
◆ read() [2/2]
int read |
( |
void * |
buffer, |
|
|
int |
size |
|
) |
| |
|
overridevirtual |
Read some bytes from the stream and store them in the given buffer. This method does not ever read as many bytes as available in the buffer even if the stream is not ended. Insteadn a read returning 0 bytes means the end of stream is reached.
- Parameters
-
buffer | Buffer to write bytes in. |
size | Size of the buffer. |
- Returns
- Number of read bytes, 0 for end of stream, -1 for an error.
Implements InStream.
References BlockInStream::size().
◆ reset()
Reset the stream to the start.
◆ size()
The documentation for this class was generated from the following files: