Input stream that support additional PeekRead operation, besides read.
More...
#include <io.h>
|
| PeekableInStream (dmlc::Stream *strm) |
|
size_t | Read (void *dptr, size_t size) override |
| reads data from a stream
|
|
virtual size_t | PeekRead (void *dptr, size_t size) |
|
void | Write (const void *, size_t) override |
| writes data to a stream
|
|
virtual | ~Stream (void) |
| virtual destructor
|
|
template<typename T > |
void | Write (const T &data) |
| writes a data to stream.
|
|
template<typename T > |
bool | Read (T *out_data) |
| loads a data from stream.
|
|
template<typename T > |
void | WriteArray (const T *data, size_t num_elems) |
| Endian aware write array of data.
|
|
template<typename T > |
bool | ReadArray (T *data, size_t num_elems) |
| Endian aware read array of data.
|
|
|
static Stream * | Create (const char *uri, const char *const flag, bool allow_null=false) |
| generic factory function create an stream, the stream will close the underlying files upon deletion
|
|
Input stream that support additional PeekRead operation, besides read.
◆ Read()
size_t xgboost::common::PeekableInStream::Read |
( |
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
|
overridevirtual |
reads data from a stream
- Parameters
-
ptr | pointer to a memory buffer |
size | block size |
- Returns
- the size of data read
Implements dmlc::Stream.
◆ Write()
void xgboost::common::PeekableInStream::Write |
( |
const void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
|
inlineoverridevirtual |
writes data to a stream
- Parameters
-
ptr | pointer to a memory buffer |
size | block size |
Implements dmlc::Stream.
The documentation for this class was generated from the following files:
- External/xgboost/src/common/io.h
- External/xgboost/src/common/io.cc