public static ulong FindDecompressedSize(byte[] inputBytes, int inputOffset, int inputCount) { if (inputBytes == null) { throw new ArgumentNullException("inputBytes"); } if (inputOffset < 0 || inputOffset >= inputBytes.Length) { throw new ArgumentOutOfRangeException("inputOffset"); } if (inputCount <= 0 || inputOffset + inputCount > inputBytes.Length) { throw new ArgumentOutOfRangeException("inputCount"); } ulong result; var inputHandle = GCHandle.Alloc(inputBytes, GCHandleType.Pinned); var inputAddress = inputHandle.AddrOfPinnedObject() + inputOffset; result = _Is64Bit == true ? ZstdNative64.FindDecompressedSize(inputAddress, (ulong)inputCount) : ZstdNative32.FindDecompressedSize(inputAddress, (uint)inputCount); inputHandle.Free(); return(result); }