public static ICommand 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.ReadCommand()); } }