public static byte[] SerializeCountMin(this CountMinSketch estimator, CountMinSketchSerializer serializer) { using (var stream = new MemoryStream()) { serializer.Serialize(stream, estimator); return(stream.ToArray()); } }
public static CountMinSketch DeserializeCountMin(this byte[] estimator, CountMinSketchSerializer serializer) { var stream = new MemoryStream(estimator); return(serializer.Deserialize(stream)); }