Documentation
When decoding, return also the number of bytes consumed