This assumed that a `read` would succeed for the full length, thus
interpreting in a subsequent call some data bits as a header.
For instance, consider 77 bytes of literal were left and a buffer of
1024 bytes was provided. Then the `read` call might return 60 which was
ignored and assumed to be 77. Thus the next 17 bytes of literal data
were instead interpreted as a header due to setting `self.count` to 0.
When the required amount of data was just a tiny bit larger than full a
page size (one buffer increment), the decoder would stop since all
compressed data had been read. However, the lzw decoder contains a small
internal bit buffer for code decoding. That is, some remaining bytes had
been retained and were still left to be decoded.
This is used in the predictor and should be reversible but for floating
point the simply addition is not. It should instead be some variant of
byte casting but it hasn't been implemented yet.
This makes it cheaper to introduce new features that might require
amending the list of variants by allowing us to introduce previously
uncovered causes or more specialized representations.
It encapsulates the implementation detail of holding a miniz_oxide
status within. The derived traits are not too extensive for other
possible representations as well.
Avoids leaking the dependency on `miniz_oxide` into the public interface
by making a constructor taking a status argument crate internal. It
would otherwise not be possible to replace the deflate decoder without
breaking that interface.
The discriminant of some enum types can be retrieved with the `as`
operator and in C style enums it is also possible to set a specific
discriminant. However, that may silently change—breaking the value
written to the file. It is better to use that technique mostly for ffi
purposes.
Several other uses that currently rely on num-traits for conversion have
no Unknown representation. Thus, the converter now outputs only known
variants or an error and the exposing function then can put the error
value into an Unknown variant instead.
Factor out parts that are unique to instantiations such as the name, the
documentation, the underlying type, the public conversion methods.
Also adds the ability to document individual items and remodels the
syntax to more closely resemble ordinary enum definitions.
There are no function changes from 0.3 but the compiler requirements
have been lowered. This avoids having to make a decision on `image`
right now, which would delay valuable bug fixes and improvements.