예제 #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()
 };