Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e9a7c3

Browse files
committed
Patch #640236: Better eplain unused data.
1 parent 5b8bfdf commit 9e9a7c3

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

Doc/lib/libzlib.tex

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,24 +123,29 @@ \section{\module{zlib} ---
123123
Decompression objects support the following methods, and two attributes:
124124

125125
\begin{memberdesc}{unused_data}
126-
A string which contains any unused data from the last string fed to
127-
this decompression object. If the whole string turned out to contain
128-
compressed data, this is \code{""}, the empty string.
126+
A string which contains any bytes past the end of the compressed data.
127+
That is, this remains \code{""} until the last byte that contains
128+
compression data is available. If the whole string turned out to
129+
contain compressed data, this is \code{""}, the empty string.
129130

130131
The only way to determine where a string of compressed data ends is by
131132
actually decompressing it. This means that when compressed data is
132133
contained part of a larger file, you can only find the end of it by
133-
reading data and feeding it into a decompression object's
134-
\method{decompress} method until the \member{unused_data} attribute is
135-
no longer the empty string.
134+
reading data and feeding it followed by some non-empty string into a
135+
decompression object's \method{decompress} method until the
136+
\member{unused_data} attribute is no longer the empty string.
136137
\end{memberdesc}
137138

138139
\begin{memberdesc}{unconsumed_tail}
139140
A string that contains any data that was not consumed by the last
140141
\method{decompress} call because it exceeded the limit for the
141-
uncompressed data buffer.
142+
uncompressed data buffer. This data has not yet been seen by the zlib
143+
machinery, so you must feed it (possibly with further data
144+
concatenated to it) back to a subsequent \method{decompress} method
145+
call in order to get correct output.
142146
\end{memberdesc}
143147

148+
144149
\begin{methoddesc}[Decompress]{decompress}{string}{\optional{max_length}}
145150
Decompress \var{string}, returning a string containing the
146151
uncompressed data corresponding to at least part of the data in

0 commit comments

Comments
 (0)