コード例 #1
0
        private void SerializeArchiveState(ArchiveState state)
        {
            SerializeString(state.ArchivePath);
            _writer.Write(state.OriginalLength);

            var originalStates = state.OriginalValues.Values.ToArray();

            _writer.Write((uint)originalStates.Length);
            for (var i = 0U; i < originalStates.Length; i++)
            {
                SerializeArchiveFileInfo(originalStates[i]);
            }
        }
コード例 #2
0
        private ArchiveState DeserializeArchiveState()
        {
            var result = new ArchiveState();

            result.ArchivePath    = DeserializeString();
            result.OriginalLength = _reader.ReadInt64();
            result.OriginalValues = new Dictionary <string, ArchiveFileInfo>();

            var count = _reader.ReadInt32();

            for (var i = 0U; i < count; i++)
            {
                var info = DeserializeArchiveFileInfo();
                result.OriginalValues[info.Path] = info;
            }

            return(result);
        }