streamly-lz4-0.1.2: Streamly combinators for LZ4 compression
Copyright(c) 2020 Composewell Technologies
LicenseApache-2.0
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streamly.Internal.LZ4.Config

Description

Frame and block configuration settings for LZ4.

Synopsis

LZ4 Frame Format

Configuration for a frame consisting of a series of blocks.

newtype FrameConfig Source #

Defines the LZ4 frame format.

Constructors

FrameConfig 

Fields

setFrameContentSize :: Bool -> FrameConfig -> FrameConfig Source #

Whether the frame header has a content size field.

Unimplemented

setFrameContentChecksum :: Bool -> FrameConfig -> FrameConfig Source #

Whether the frame footer has a content checksum after the end mark. If it is True then it implicitly indicates that setEndMark is set to True.

Unimplemented

setFrameDictionaryId :: Bool -> FrameConfig -> FrameConfig Source #

Whether the frame header has a dictionary ID field.

Unimplemented

setFrameBlockIndependence :: Bool -> FrameConfig -> FrameConfig Source #

When False, future blocks in the frame may depend on the past blocks. Block dependency improves compression ratio, especially for small blocks. On the other hand, it makes random access or multi-threaded decoding impossible.

Unimplemented

setFrameBlockChecksum :: Bool -> FrameConfig -> FrameConfig Source #

Indicate whether blocks in the frame are followed by a 4-byte checksum field.

Unimplemented

setFrameEndMark :: Bool -> FrameConfig -> FrameConfig Source #

Whether the frame footer has an end mark.

LZ4 Block Format

Configuration for a single compressed block.

newtype BlockConfig Source #

Defines the LZ4 compressed block format. Please note that the Uncompressed length field is optional and not in the LZ4 specification.

 ----------------------------------------------------------------------
| Compressed length | Uncompressed length | Data | Checksum            |
|       (4 byte)    | (4 byte) (optional) |      | (4 byte) (optional) |
 ----------------------------------------------------------------------

Compressed length is the length of the Data field only. Uncompressed length is present only when the setBlockMaxSize is set to BlockHasSize. Checksum is present when setBlockChecksum is set to True. The 4-byte fields are stored in machine byte order.

Constructors

BlockConfig 

Fields

data BlockSize Source #

Maximum uncompressed size of a data block.

Constructors

BlockHasSize

Block header has uncompressed size after the compressed size field. Please note that this option is not in the LZ4 specification.

BlockMax64KB 
BlockMax256KB 
BlockMax1MB 
BlockMax4MB 

setBlockMaxSize :: BlockSize -> BlockConfig -> BlockConfig Source #

Set the maximum uncompressed size of the data block.

setBlockIndependence :: Bool -> BlockConfig -> BlockConfig Source #

When False, the block may depend on the past blocks.

Unimplemented

setBlockChecksum :: Bool -> BlockConfig -> BlockConfig Source #

Indicate whether the block is followed by a 4-byte checksum field.

Unimplemented