Class: ActiveSupport::Cache::ZstdCompressor::WithZlibFallback

Inherits:
ActiveSupport::Cache::ZstdCompressor show all
Defined in:
lib/active_support/cache/zstd_compressor/with_zlib_fallback.rb

Constant Summary collapse

ZSTD_MAGIC_NUMBER =

ZStandard Magic Number (0xFD2FB528) in little-endian format. See: datatracker.ietf.org/doc/html/rfc8878#name-zstandard-frames

[0xFD2FB528].pack("L<")

Constants inherited from ActiveSupport::Cache::ZstdCompressor

VERSION

Instance Attribute Summary

Attributes inherited from ActiveSupport::Cache::ZstdCompressor

#level

Instance Method Summary collapse

Methods inherited from ActiveSupport::Cache::ZstdCompressor

#deflate, #initialize

Constructor Details

This class inherits a constructor from ActiveSupport::Cache::ZstdCompressor

Instance Method Details

#inflate(deflated) ⇒ Object



13
14
15
16
17
# File 'lib/active_support/cache/zstd_compressor/with_zlib_fallback.rb', line 13

def inflate(deflated)
  return super if deflated.b.start_with?(ZSTD_MAGIC_NUMBER)

  Zlib.inflate(deflated)
end