Esempio n. 1
0
        public AssetWriter(string input, int[] manualSkips = null, int[] forceReads = null)
        {
            this.path = input;
            data      = new AssetReader();
            var ourReader = data.PathToReader(path);

            data.Read(ourReader, manualSkips, forceReads);
        }
Esempio n. 2
0
        // willStoreOriginalCopyInMemory uses double the memory (!) but allows saving even after the original file on disk has been deleted
        public AssetWriter(string input, bool willStoreOriginalCopyInMemory = false, bool willWriteSectionSix = true, int[] manualSkips = null, int[] forceReads = null)
        {
            this.path = input;
            this.WillStoreOriginalCopyInMemory = willStoreOriginalCopyInMemory;
            this.WillWriteSectionSix           = willWriteSectionSix;

            data = new AssetReader();
            var ourReader = data.PathToReader(path);

            data.Read(ourReader, manualSkips, forceReads);

            if (WillStoreOriginalCopyInMemory)
            {
                ourReader.BaseStream.Seek(0, SeekOrigin.Begin);
                OriginalCopy = ourReader.ReadBytes((int)ourReader.BaseStream.Length);
            }
        }