Skip to content

IsLikelyBrotli Method ​

Definition ​

  • Namespace: JASE.Extensions
  • Assembly: JASE.Compression.dll

Overloads ​

NameDescription
bool IsLikelyBrotli(byte[] bytes)Returns true if the byte array starts with Zip file header bytes
bool IsLikelyBrotli(ReadOnlySpan<byte> bytes, int maxInputBytes = null, int maxOutputBytes = null)Best-effort Brotli detection by attempting a bounded decompression. This is NOT a magic-byte check and may yield false negatives/positives on arbitrary data.

bool IsLikelyBrotli(byte[] bytes) ​

csharp
bool IsLikelyBrotli(byte[] bytes)

Returns true if the byte array starts with Zip file header bytes

bool IsLikelyBrotli(ReadOnlySpan<byte> bytes, int maxInputBytes = null, int maxOutputBytes = null) ​

csharp
bool IsLikelyBrotli(ReadOnlySpan<byte> bytes, int maxInputBytes = null, int maxOutputBytes = null)

Best-effort Brotli detection by attempting a bounded decompression. This is NOT a magic-byte check and may yield false negatives/positives on arbitrary data.

Parameters ​

NameDescription
bytesCandidate Brotli bytes.
maxInputBytesMaximum bytes to feed to the decompressor.
maxOutputBytesMaximum decompressed bytes to attempt reading.