コード例 #1
0
ファイル: UpdateEntry.cs プロジェクト: Azyyyyyy/TinyUpdate
        private void ProcessFileEntry(FileEntry fileEntry)
        {
            //Get rid of any streams that will be empty
            if (fileEntry.Filesize == 0)
            {
                fileEntry.Stream?.Dispose();
                fileEntry.Stream = null;
            }

            //Add to the correct
            if (fileEntry.IsDeltaFile())
            {
                DeltaFile.Add(fileEntry);
                return;
            }

            if (fileEntry.IsNewFile())
            {
                NewFile.Add(fileEntry);
                return;
            }

            if (fileEntry.DeltaExtension.EndsWith("load"))
            {
                LoaderFile = fileEntry;
                return;
            }

            SameFile.Add(fileEntry);
        }
コード例 #2
0
        private void WriteExports()
        {
            NewFile.AddRange(EncodingUtil.encoding.GetBytes("EXPORT_DATA"));
            NewFile.Add(new byte());

            foreach (Export export in Exports)
            {
                NewFile.AddRange(export.Write());
            }
        }
コード例 #3
0
        private void WriteCollectionLink()
        {
            NewFile.AddRange(EncodingUtil.encoding.GetBytes("COLLECTION_LINK"));
            NewFile.Add(new byte());
            NewFile.AddRange(BitConverter.GetBytes(0));

            UInt32 newCollectionLinkAddress = (UInt32)NewFile.Count + 4 + COLLECTION_LINK_PADDING;

            NewFile.AddRange(BitConverter.GetBytes(newCollectionLinkAddress));
            NewFile.AddRange(new byte[COLLECTION_LINK_PADDING]);
        }