mxnet
|
writer of binary recordio binary format for recordio recordio format: magic lrecord data pad More...
#include <recordio.h>
Public Member Functions | |
RecordIOWriter (Stream *stream) | |
constructor More... | |
void | WriteRecord (const void *buf, size_t size) |
write record to the stream More... | |
void | WriteRecord (const std::string &data) |
write record to the stream More... | |
size_t | except_counter (void) const |
size_t | Tell (void) |
tell the current position of the input stream More... | |
Static Public Member Functions | |
static uint32_t | EncodeLRec (uint32_t cflag, uint32_t length) |
encode the lrecord More... | |
static uint32_t | DecodeFlag (uint32_t rec) |
decode the flag part of lrecord More... | |
static uint32_t | DecodeLength (uint32_t rec) |
decode the length part of lrecord More... | |
Static Public Attributes | |
static const uint32_t | kMagic = 0xced7230a |
magic number of recordio note: (kMagic >> 29U) & 7 > 3 this ensures lrec will not be kMagic More... | |
writer of binary recordio binary format for recordio recordio format: magic lrecord data pad
cflag was used to handle (rare) special case when magic number occured in the data sequence.
In such case, the data is splitted into multiple records by the cells of magic number
(1) cflag == 0: this is a complete record; (2) cflag == 1: start of a multiple-rec; cflag == 2: middle of multiple-rec; cflag == 3: end of multiple-rec
|
inlineexplicit |
constructor
stream | the stream to be constructed |
|
inlinestatic |
decode the flag part of lrecord
rec | the lrecord |
|
inlinestatic |
decode the length part of lrecord
rec | the lrecord |
|
inlinestatic |
encode the lrecord
cflag | cflag part of the lrecord |
length | length part of lrecord |
|
inline |
|
inline |
tell the current position of the input stream
void dmlc::RecordIOWriter::WriteRecord | ( | const void * | buf, |
size_t | size | ||
) |
write record to the stream
buf | the buffer of memory region |
size | the size of record to write out |
|
inline |
write record to the stream
data | the data to write out |
|
static |
magic number of recordio note: (kMagic >> 29U) & 7 > 3 this ensures lrec will not be kMagic