Exemplo n.º 1
0
 public static int snappy_max_compressed_length(int input_length)
 {
     if (__is64BitProcess)
     {
         return((int)Snappy64NativeMethods.snappy_max_compressed_length((ulong)input_length));
     }
     else
     {
         return((int)Snappy32NativeMethods.snappy_max_compressed_length((uint)input_length));
     }
 }
Exemplo n.º 2
0
 public static SnappyStatus snappy_validate_compressed_buffer(IntPtr input, int input_length)
 {
     if (__is64BitProcess)
     {
         return(Snappy64NativeMethods.snappy_validate_compressed_buffer(input, (ulong)input_length));
     }
     else
     {
         return(Snappy32NativeMethods.snappy_validate_compressed_buffer(input, (uint)input_length));
     }
 }
Exemplo n.º 3
0
            public static SnappyStatus snappy_uncompressed_length(IntPtr input, int input_length, out int output_length)
            {
                SnappyStatus status;

                if (__is64BitProcess)
                {
                    status        = Snappy64NativeMethods.snappy_uncompressed_length(input, (ulong)input_length, out var ulongOutput_length);
                    output_length = (int)ulongOutput_length;
                }
                else
                {
                    status        = Snappy32NativeMethods.snappy_uncompressed_length(input, (uint)input_length, out var uintOutput_length);
                    output_length = (int)uintOutput_length;
                }
                return(status);
            }
Exemplo n.º 4
0
            public static SnappyStatus snappy_compress(IntPtr input, int input_length, IntPtr output, ref int output_length)
            {
                SnappyStatus status;

                if (__is64BitProcess)
                {
                    var ulongOutput_length = (ulong)output_length;
                    status        = Snappy64NativeMethods.snappy_compress(input, (ulong)input_length, output, ref ulongOutput_length);
                    output_length = (int)ulongOutput_length;
                }
                else
                {
                    var uintOutput_length = (uint)output_length;
                    status        = Snappy32NativeMethods.snappy_compress(input, (uint)input_length, output, ref uintOutput_length);
                    output_length = (int)uintOutput_length;
                }

                return(status);
            }