示例#1
0
        public static IResponse Deserialize(IPCReader reader)
        {
            var commandData = reader.ReadLengthPrefixedBlob();

            using (var uncompresedStream = new MemoryStream())
            {
                using (var inputStream = new MemoryStream(commandData))
                    using (var dstream = new DeflateStream(inputStream, CompressionMode.Decompress))
                        dstream.CopyTo(uncompresedStream);

                uncompresedStream.Seek(0, SeekOrigin.Begin);
                using (var uncompressedReader = new IPCReader(uncompresedStream))
                    return(uncompressedReader.ReadResponse());
            }
        }
示例#2
0
 public static Deploy Deserialize(IPCReader reader) => new Deploy
 {
     Data        = reader.ReadLengthPrefixedBlob(),
     Destination = reader.ReadString()
 };
示例#3
0
 public static ResultRangeFetched Deserialize(IPCReader reader) => new ResultRangeFetched
 {
     Data      = reader.ReadLengthPrefixedBlob(),
     Timestamp = reader.ReadDateTime(),
     Status    = (FetchStatus)reader.ReadByte()
 };
示例#4
0
 public static PutFileCommand Deserialize(IPCReader reader) => new PutFileCommand
 {
     Data    = reader.ReadLengthPrefixedBlob(),
     Path    = reader.ReadString(),
     WorkDir = reader.ReadString()
 };