/// <summary>
 /// Performs a lazy initialization of the native encoder using the default Quality and Window values:
 /// BROTLI_DEFAULT_WINDOW 22
 /// BROTLI_DEFAULT_QUALITY 11
 /// </summary>
 internal void InitializeEncoder()
 {
     EnsureNotDisposed();
     _state = Interop.Brotli.BrotliEncoderCreateInstance(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
     if (_state.IsInvalid)
     {
         throw new IOException(SR.BrotliEncoder_Create);
     }
 }
 public BrotliEncoder(int quality, int window)
 {
     _disposed = false;
     _state    = Interop.Brotli.BrotliEncoderCreateInstance(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
     if (_state.IsInvalid)
     {
         throw new IOException(SR.BrotliEncoder_Create);
     }
     SetQuality(quality);
     SetWindow(window);
 }
Exemple #3
0
 internal static partial BOOL BrotliEncoderHasMoreOutput(SafeBrotliEncoderHandle state);
Exemple #4
0
 internal static unsafe partial BOOL BrotliEncoderCompressStream(
     SafeBrotliEncoderHandle state, BrotliEncoderOperation op, ref nuint availableIn,
     byte **nextIn, ref nuint availableOut, byte **nextOut, out nuint totalOut);
Exemple #5
0
 internal static partial BOOL BrotliEncoderSetParameter(SafeBrotliEncoderHandle state, BrotliEncoderParameter parameter, uint value);
 internal static extern bool BrotliEncoderHasMoreOutput(SafeBrotliEncoderHandle state);
 internal static extern unsafe bool BrotliEncoderCompressStream(
     SafeBrotliEncoderHandle state, BrotliEncoderOperation op, ref size_t availableIn,
     byte **nextIn, ref size_t availableOut, byte **nextOut, out size_t totalOut);
 internal static extern bool BrotliEncoderSetParameter(SafeBrotliEncoderHandle state, BrotliEncoderParameter parameter, UInt32 value);
Exemple #9
0
 internal static bool BrotliEncoderHasMoreOutput(SafeBrotliEncoderHandle state) =>
 throw new PlatformNotSupportedException();
Exemple #10
0
 internal static unsafe bool BrotliEncoderCompressStream(
     SafeBrotliEncoderHandle state, BrotliEncoderOperation op, ref size_t availableIn,
     byte **nextIn, ref size_t availableOut, byte **nextOut, out size_t totalOut) =>
 throw new PlatformNotSupportedException();
Exemple #11
0
 internal static bool BrotliEncoderSetParameter(SafeBrotliEncoderHandle state, BrotliEncoderParameter parameter, UInt32 value) =>
 throw new PlatformNotSupportedException();