~mmach/netext73/lz4

« back to all changes in this revision

Viewing changes to examples/streaming_api_basics.md

  • Committer: mmach
  • Date: 2022-11-09 18:52:10 UTC
  • Revision ID: netbit73@gmail.com-20221109185210-w358idlhh0phq688
1.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
   It guarantees interoperability with other LZ4 framing format compliant tools/libraries
10
10
   such as LZ4 command line utility, node-lz4, etc.
11
11
 - "Block" API : This is recommended for simple purpose.
12
 
   It compress single raw memory block to LZ4 memory block and vice versa.
 
12
   It compresses single raw memory block to LZ4 memory block and vice versa.
13
13
 - "Streaming" API : This is designed for complex things.
14
14
   For example, compress huge stream data in restricted memory environment.
15
15
 
22
22
Block API (de)compresses a single contiguous memory block.
23
23
In other words, LZ4 library finds redundancy from a single contiguous memory block.
24
24
Streaming API does same thing but (de)compresses multiple adjacent contiguous memory blocks.
25
 
So LZ4 library could find more redundancy than Block API.
 
25
So Streaming API could find more redundancy than Block API.
26
26
 
27
27
The following figure shows difference between API and block sizes.
28
28
In these figures, the original data is split into 4KiBytes contiguous chunks.