# `GorillaStream.Compression.Gorilla.Decoder`
[🔗](https://github.com/awksedgreep/gorilla_stream/blob/main/lib/gorilla_stream/compression/gorilla/decoder.ex#L1)

Main decoder for the Gorilla compression algorithm.

This module coordinates the decompression pipeline:
1. Extracts and validates metadata header
2. Unpacks the combined bitstream into timestamp and value components
3. Applies delta-of-delta decoding to timestamps
4. Applies XOR-based decompression to values
5. Recombines timestamps and values into the original stream

The Gorilla algorithm is specifically designed for time series data with
regularly spaced timestamps and slowly changing floating-point values.

# `decode`

Decodes compressed binary data back into a stream of {timestamp, float} tuples.

## Parameters
- `encoded_data`: Binary data to decode

## Returns
- `{:ok, decoded_data}`: When decoding is successful
- `{:error, reason}`: When decoding fails

# `decode_and_validate`

Decodes and validates the result matches expected characteristics.

## Parameters
- `encoded_data`: Binary data to decode
- `validation_opts`: Optional validation parameters

## Returns
- `{:ok, {stream, stats}}`: Decoded stream and statistics
- `{:error, reason}`: If decoding or validation fails

# `decode_elixir`

Pure-Elixir decode, used as fallback when NIF is unavailable.

# `estimate_decompression_performance`

Estimates decompression performance for given compressed data.

## Parameters
- `encoded_data`: Binary data to analyze

## Returns
- `{:ok, performance_info}`: Performance estimates
- `{:error, reason}`: If analysis fails

# `get_compression_info`

Gets information about compressed data without full decompression.

## Parameters
- `encoded_data`: Binary data to analyze

## Returns
- `{:ok, info}` with compression information, or `{:error, reason}`

# `nif_available?`

Returns true if the native NIF decoder is available.

# `validate_compressed_data`

Validates that compressed data can be properly decoded without full decompression.

## Parameters
- `encoded_data`: Binary data to validate

## Returns
- `:ok` if valid, `{:error, reason}` if invalid

---

*Consult [api-reference.md](api-reference.md) for complete listing*
