public static unsafe int GetDecompressedLength(byte[] sourceBytes, int sourceIndex) { if (sourceBytes == null) { AcedMCException.ThrowArgumentNullException("sourceBytes"); fixed(byte *pSrcBytes = &sourceBytes[sourceIndex]) { int result = *((int *)pSrcBytes); if (result >= 0) { return(result); } return(-result); } }
public unsafe byte[] Decompress(byte[] sourceBytes, int sourceIndex, int beforeGap, int afterGap) { if (sourceBytes == null) { AcedMCException.ThrowArgumentNullException("sourceBytes"); } int byteCount; fixed(byte *pSrcBytes = &sourceBytes[sourceIndex]) byteCount = *((int *)pSrcBytes); if (byteCount < 0) { byteCount = -byteCount; } byte[] result = new byte[byteCount + beforeGap + afterGap]; if (byteCount != 0) { Decompress(sourceBytes, sourceIndex, result, beforeGap); } return(result); }
public unsafe int Decompress(byte[] sourceBytes, int sourceIndex, byte[] destinationBytes, int destinationIndex) { if (sourceBytes == null) AcedMCException.ThrowArgumentNullException("sourceBytes"); }