Esempio n. 1
0
        public static int UncompressedLength(byte[] src, int src_offset, int src_size)
        {
            unsafe
            {
                fixed(byte *srcPtr = src)
                {
                    var ptrSrc = new IntPtr((void *)srcPtr) + src_offset;
                    var status = Libsnappy._snappy_uncompressed_length(ptrSrc, new UIntPtr((uint)src_size), out var size);

                    if (status == SnappyStatusEnum.SNAPPY_OK)
                    {
                        return((int)size.ToUInt32());
                    }

                    throw new SnappyException(status);
                }
            }
        }