[ 
https://issues.apache.org/jira/browse/AVRO-1665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14529761#comment-14529761
 ] 

Konstantin Shaposhnikov commented on AVRO-1665:
-----------------------------------------------

Another alternative is to make binary format configurable in JSON 
encoder/decoder. 

Something like:

{code}
enum BytesJsonFormat { STRING, BASE64 }

encoder.setBytesFormat(BytesJsonFormat format)
decoder.setBytesFormat(BytesJsonFormat format)
{code}


Creating another pair of encoder/decoder classes that use base64 for BYTES and 
incorporate proposal from AVRO-1582 and probably some other changes is a good 
approach as well. Especially that it can be implemented in AVRO 1.8 without 
need to wait for AVRO 2.0

> Provide way to represent BYTES type using base64 encoding in JSON
> -----------------------------------------------------------------
>
>                 Key: AVRO-1665
>                 URL: https://issues.apache.org/jira/browse/AVRO-1665
>             Project: Avro
>          Issue Type: Improvement
>    Affects Versions: 1.7.7
>            Reporter: Konstantin Shaposhnikov
>
> Currently JsonEncoder and JsonDecoder represent BYTES type as String encoded 
> using ISO-8859-1 charset.
> It would be good to provide option to use base64 encoding (e.g. using jackson 
> JsonGenerator.writeBinary(byte[] data, int offset, int len) method).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to