Commit d18a8c6f authored by ale's avatar ale

add method to deserialize Features

parent c4ca66f4
......@@ -31,6 +31,11 @@ type Features struct {
ptr C.imms_features_t
}
func NewFeaturesFromData(data []byte) *Features {
bufPtr := (*C.char)(unsafe.Pointer(&data[0]))
return &Features{C.imms_features_from_data(bufPtr, C.int(len(data)))}
}
func (f *Features) Data() []byte {
n := C.imms_features_data_size()
buf := make([]byte, n)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment