Add EncodeBytes and DecodeBytes functions

I agree that these changes are covered by the license contained in the repository.