GorillaStream.Compression.Decoder.BitUnpacking (gorilla_stream v3.0.3)

Copy Markdown View Source

Bit unpacking module for extracting timestamp and value bitstreams from packed binary data.

This module reverses the bit packing process to separate the combined bitstream back into its timestamp and value components for individual decompression.

The unpacking process:

  1. Uses metadata to determine bitstream lengths
  2. Extracts timestamp bitstream
  3. Extracts value bitstream
  4. Returns both components with metadata for decompression

Summary

Functions

Estimates unpacking performance for given packed data.

Gets information about packed data without full unpacking.

Unpacks binary data into timestamp and value bitstreams using metadata.

Validates that packed data can be properly unpacked.

Functions

estimate_unpacking_performance(packed_data)

Estimates unpacking performance for given packed data.

Parameters

  • packed_data: Binary data to analyze

Returns

  • {:ok, performance_info}: Performance estimates
  • {:error, reason}: If analysis fails

get_packed_info(packed_data)

Gets information about packed data without full unpacking.

Parameters

  • packed_data: Binary data to analyze

Returns

  • {:ok, info} with basic information, or {:error, reason}

unpack(packed_data)

Unpacks binary data into timestamp and value bitstreams using metadata.

Parameters

  • packed_data: Binary data containing packed timestamp and value bitstreams

Returns

  • {timestamp_bits, value_bits, metadata}: Tuple containing unpacked components and metadata

validate_packed_data(packed_data)

Validates that packed data can be properly unpacked.

Parameters

  • packed_data: Binary data to validate

Returns

  • :ok if valid, {:error, reason} if invalid