element to get
pointer to read buffer
pointer to buffer length
ErrorCode
auto h = new HiBON; string key_binary = "binary"; immutable(ubyte[]) binary_data = [0,1,0,1]; h[key_binary] = binary_data; const doc = Document(h); Document.Element elm_binary; int rt = tagion_document_element_by_key(&doc.data[0], doc.data.length, &key_binary[0], key_binary.length, &elm_binary); assert(rt == ErrorCode.none, "Get document element binary returned error"); uint8_t* buf; size_t buf_len; rt = tagion_document_get_u8_array(&elm_binary, &buf, &buf_len); assert(rt == ErrorCode.none); auto read_data = cast(immutable) buf[0..buf_len]; assert(binary_data == read_data);
Get binary from a document