#include <base/io/MemoryInputStream.h>
Inherits InputStream.
◆ available()
unsigned int MemoryInputStream::available |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Returns the number of bytes that can be read or skipped over without blocking under normal circumstances. The number of returned bytes may be less than the true number of bytes available. Attempting to read the number of bytes returned by the function may block the calling thread if some process has acquired a lock on the object (e.g. file locking).
- Returns
- Available number of bytes in stream.
Implements InputStream.
◆ close()
void MemoryInputStream::close |
( |
| ) |
|
|
inlinevirtualnoexcept |
Closes the stream and releases any system resources associated with the stream.
Implements Stream.
◆ read()
unsigned int MemoryInputStream::read |
( |
uint8 * |
buffer, |
|
|
unsigned int |
size, |
|
|
bool |
nonblocking |
|
) |
| |
|
virtual |
Fills the specified buffer with bytes from the stream. In blocking mode the method does not return until all bytes have been read. In non-blocking mode the total bytes read may be any number below or equal to the requested number of bytes. Attempting to read beyond the end of a stream in blocking mode results in an EndOfFile exception.
- Parameters
-
buffer | The buffer to receive the bytes. |
size | The size of the buffer. |
nonblocking | Specifies that the method may not block. |
- Returns
- The actual number of bytes read from the stream.
Implements InputStream.
◆ skip()
unsigned int MemoryInputStream::skip |
( |
unsigned int |
count | ) |
|
|
inlinevirtualnoexcept |
Skips a specified number of bytes. Blocks if asked to skip more bytes than available.
- Parameters
-
count | The number of bytes to skip. |
- Returns
- The actual number of bytes skipped.
Implements InputStream.
◆ wait() [1/2]
void MemoryInputStream::wait |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Blocking wait for input to become available.
Implements InputStream.
◆ wait() [2/2]
bool MemoryInputStream::wait |
( |
unsigned int |
timeout | ) |
const |
|
inlinevirtualnoexcept |
Blocking wait for input to become available.
- Parameters
-
timeout | The timeout periode in microseconds. |
- Returns
- True, if data is available. False, if the timeout periode expired.
Implements InputStream.