APIResponseCompression class
The response compression configuration.
Constructors
-
APIResponseCompression({List<
APIContentEncoding> encodings = APIContentEncoding.defaultEncodings, int gzipLevel = defaultGzipLevel, int brotliQuality = APIBrotli.defaultQuality, int minLength = defaultMinLength}) -
const
Properties
- brotliQuality → int
-
The Brotli quality (
0to11).final -
encodings
→ List<
APIContentEncoding> -
The accepted encodings, in order of preference.
An empty list disables the compression.
final
- gzipLevel → int
-
The GZip compression level (
1to9).final - hashCode → int
-
The hash code for this object.
no setteroverride
- isEnabled → bool
-
Returns
trueif any encoding is enabled.no setter - minLength → int
-
The minimal content length to compress.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{List< APIContentEncoding> ? encodings, int? gzipLevel, int? brotliQuality, int? minLength}) → APIResponseCompression -
encode(
Uint8List bytes, APIContentEncoding encoding) → Uint8List? -
Encodes
byteswithencoding, using this configuration. -
encodeAsync(
Uint8List bytes, APIContentEncoding encoding) → FutureOr< Uint8List?> - Same as encode, but a large Brotli encoding runs in a background Isolate. See encodeContentAsync.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveAcceptedEncoding(
Map< String, double> accepted) → APIContentEncoding? -
Resolves the APIContentEncoding for an already parsed
Accept-Encoding(parseAcceptEncoding). -
resolveEncoding(
String? value) → APIContentEncoding? -
Resolves the APIContentEncoding for the
Accept-Encodingheadervalue. See resolveContentEncoding. -
resolveRequestEncoding(
Request request) → APIContentEncoding? -
Resolves the APIContentEncoding for
request. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- defaultGzipLevel → const int
- The default GZip compression level.
- defaultMinLength → const int
- The default minimal content length to compress.
- none → const APIResponseCompression
- No compression.