Пример #1
0
 public void Keep()
 {
     if (this._reportMessage == null)
     {
         return;
     }
     using (Stream writeStream = Memory.ActiveBox.Storage.GetWriteStream(this.Key))
         ReportMessage.Serialize(writeStream, this._reportMessage);
 }
Пример #2
0
 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));
     }
 }
Пример #3
0
 public static void Write(this ReportMessage message, Stream requestStream)
 {
     using (GZipStream gzipStream = new GZipStream(requestStream, CompressionMode.Compress, true))
         ReportMessage.Serialize((Stream)gzipStream, message);
 }