예제 #1
0
        private bool SerializeOodleDecompressData(FOodleCompressedData dataInfo, out byte[] outData)
        {
            outData = new byte[0];
            var decompressedLength = (int)dataInfo.DecompressedLength;
            var compressedLength   = (int)dataInfo.CompressedLength;

            if (compressedLength > _innerArchive.Length - dataInfo.Offset || decompressedLength > MAX_COMPRESS_BUFFER ||
                compressedLength > MAX_COMPRESS_BUFFER)
            {
                return(false);
            }

            _innerArchive.Position = dataInfo.Offset;
            if (compressedLength == decompressedLength)
            {
                outData = _innerArchive.ReadBytes(decompressedLength);
            }
            else
            {
                outData = new byte[decompressedLength];
                var compressedData = _innerArchive.ReadBytes(compressedLength);
                Compression.Oodle.Decompress(compressedData, 0, compressedLength, outData, 0, decompressedLength);
            }

            return(outData.Length == decompressedLength);
        }
예제 #2
0
 public FDictionaryHeader(FArchive Ar)
 {
     Magic                   = Ar.Read <uint>();
     DictionaryVersion       = Ar.Read <uint>();
     OodleMajorHeaderVersion = Ar.Read <uint>();
     HashTableSize           = Ar.Read <int>();
     DictionaryData          = Ar.Read <FOodleCompressedData>();
     CompressorData          = Ar.Read <FOodleCompressedData>();
 }