bluelinelabs / LoganSquare

Screaming fast JSON parsing and serialization library for Android.
Apache License 2.0
3.21k stars 306 forks source link

Need []byte Base64 encoding/decoding #122

Open Qubitium opened 8 years ago

Qubitium commented 8 years ago

JSON byte[] must be transmitted as base64 (default) or some other non-json-violating format since byte[] can contain quotes, colons, brackets symbols used by json spec.

[]byte Serialize: --> first Base64.encode(in, Base64.DEFAULT)

[]byte Deserialize: --> Base64.decode(in, Base64.DEFAULT)

Having the above auto support would be great and inline with other JSON parsers.

Qubitium commented 8 years ago

For those that need []byte Base64 support. For now you can create a new Object class that wraps a []byte and use a Custom StrintConverter to do the base64 encoding/decoding.