Example #1
0
 public byte[] ReadLZSS(uint expectedSize, bool inPAA = false)
 {
     if (expectedSize < 1024 && !inPAA) //data is always compressed in PAAs
     {
         return(ReadBytes((int)expectedSize));
     }
     else
     {
         var dst = new byte[expectedSize];
         LZSS.ReadLZSS(BaseStream, out dst, expectedSize, inPAA); //PAAs calculate checksums with signed byte values
         return(dst);
     }
 }
 public byte[] ReadLZSS(uint expectedSize, bool inPAA = false)
 {
     if (expectedSize < 1024 && !inPAA) //data is always compressed in PAAs
     {
         return(ReadBytes((int)expectedSize));
     }
     else
     {
         // XXX: Needs testing
         //var buffer = new byte[expectedSize];
         //using (var lzss = new LzssStream(BaseStream, CompressionMode.Decompress, true))
         //{
         //    lzss.Read(buffer, 0, (int)expectedSize);
         //}
         //Chesksum(inPAA, buffer); //PAAs calculate checksums with signed byte values
         byte[] buffer;
         LZSS.ReadLZSS(BaseStream, out buffer, expectedSize, inPAA);
         return(buffer);
     }
 }