public void Keep() { if (this._reportMessage == null) { return; } using (Stream writeStream = Memory.ActiveBox.Storage.GetWriteStream(this.Key)) ReportMessage.Serialize(writeStream, this._reportMessage); }
public static string ToProtobufString <T>(this T obj) where T : ReportMessage { using (MemoryStream memoryStream = new MemoryStream()) { ReportMessage.Serialize((Stream)memoryStream, (ReportMessage)obj); byte[] array = memoryStream.ToArray(); return(Encoding.UTF8.GetString(array, 0, array.Length)); } }
public static void Write(this ReportMessage message, Stream requestStream) { using (GZipStream gzipStream = new GZipStream(requestStream, CompressionMode.Compress, true)) ReportMessage.Serialize((Stream)gzipStream, message); }