~mmach/netext73/lz4

« back to all changes in this revision

Viewing changes to examples/blockStreaming_lineByLine.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:
1
1
# LZ4 Streaming API Example : Line by Line Text Compression
2
2
by *Takayuki Matsuoka*
3
3
 
4
 
`blockStreaming_lineByLine.c` is LZ4 Straming API example which implements line by line incremental (de)compression.
 
4
`blockStreaming_lineByLine.c` is LZ4 Streaming API example which implements line by line incremental (de)compression.
5
5
 
6
6
Please note the following restrictions :
7
7
 
107
107
In Line#X+2 (see (5)), finally LZ4 forget almost all memories but still remains Line#X+1.
108
108
This is the same situation as Line#2.
109
109
 
110
 
Continue these procedure to the end of text file.
 
110
Continue these procedures to the end of text file.
111
111
 
112
112
 
113
113
## How the decompression works
117
117
 - Read compressed line from the file to buffer.
118
118
 - Decompress it to the ringbuffer.
119
119
 - Output decompressed plain text line to the file.
120
 
 - Forward ringbuffer offset. If offset exceedes end of the ringbuffer, reset it.
 
120
 - Forward ringbuffer offset. If offset exceeds end of the ringbuffer, reset it.
121
121
 
122
 
Continue these procedure to the end of the compressed file.
 
122
Continue these procedures to the end of the compressed file.