
One issue with the previous implementation was that isUnsynchronized would not be set back to false if previously set to true and if the next header has majorVersion >= 4. In general, having the decoder be stateless is clearer (and thread safe, albeit that this property is not required).