Example #1
0
        public RAFDirectoryFile(RAFArchive raf, string location)
        {
            this.raf = raf;
            content = System.IO.File.ReadAllBytes(location);
            magic = BitConverter.ToUInt32(content.SubArray(0, 4), 0);
            version = BitConverter.ToUInt32(content.SubArray(4, 4), 0);
            mgrIndex = BitConverter.ToUInt32(content.SubArray(8, 4), 0);
            offsetFileList = BitConverter.ToUInt32(content.SubArray(12, 4), 0);
            offsetStringTable = BitConverter.ToUInt32(content.SubArray(16, 4), 0);

            //UINT32 is casted to INT32.  This should be fine, since i doubt that the RAF will become
            //a size of 2^31-1 in bytes.

            fileList = new RAFFileList(raf, content, offsetFileList);
            
            //Now we load our string table
            stringTable = new RAFStringTable(raf, content, offsetStringTable);
        }
        public RAFDirectoryFile(RAFArchive raf, string location)
        {
            this.raf          = raf;
            content           = System.IO.File.ReadAllBytes(location);
            magic             = BitConverter.ToUInt32(content.SubArray(0, 4), 0);
            version           = BitConverter.ToUInt32(content.SubArray(4, 4), 0);
            mgrIndex          = BitConverter.ToUInt32(content.SubArray(8, 4), 0);
            offsetFileList    = BitConverter.ToUInt32(content.SubArray(12, 4), 0);
            offsetStringTable = BitConverter.ToUInt32(content.SubArray(16, 4), 0);

            //UINT32 is casted to INT32.  This should be fine, since i doubt that the RAF will become
            //a size of 2^31-1 in bytes.

            fileList = new RAFFileList(raf, content, offsetFileList);

            //Now we load our string table
            stringTable = new RAFStringTable(raf, content, offsetStringTable);
        }