protobuf functions now returns offsets instread pointers
encodeZigZag