/// <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); }
internal static partial BOOL BrotliEncoderHasMoreOutput(SafeBrotliEncoderHandle state);
internal static unsafe partial BOOL BrotliEncoderCompressStream( SafeBrotliEncoderHandle state, BrotliEncoderOperation op, ref nuint availableIn, byte **nextIn, ref nuint availableOut, byte **nextOut, out nuint totalOut);
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);
internal static bool BrotliEncoderHasMoreOutput(SafeBrotliEncoderHandle state) => throw new PlatformNotSupportedException();
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();
internal static bool BrotliEncoderSetParameter(SafeBrotliEncoderHandle state, BrotliEncoderParameter parameter, UInt32 value) => throw new PlatformNotSupportedException();