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

David Lemieux commented on AVRO-1584:
-------------------------------------

Ryan,

I am not quite sure what you mean by Fixed. Are you talking about 
org.apache.avro.specific.SpecificFixed ?
If so, I can look into it.

As for using a library method, I can as well.
I opted for that implementation because I could not find a library that would 
work on ByteBuffer without making a copy to a byte[] first.
I think saving a copy is worth it, but I don't have that much time to spend on 
this either.
Your call.

If we keep to the currently proposed version and I also look into Fixed.
It will make sense to extract that method to some common ground.
Without knowing the code base that well, I would put it into 
org.apache.avro.util.Base64
Do you know a better place?

I'll wait for your answer before jumping on it.

> Json output doesn't generate base64 for byte arrays
> ---------------------------------------------------
>
>                 Key: AVRO-1584
>                 URL: https://issues.apache.org/jira/browse/AVRO-1584
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.7
>         Environment: Pure java.
>            Reporter: Christophe Lorenz
>         Attachments: AVRO-1584.patch
>
>
> The Json output of java generated code doesn't correctly encode byte arrays.
> Using this simple schema : 
> {"namespace": "example.avro",
>  "type": "record",
>  "name": "ByteArrayEncoding",
>  "fields": [     {"name": "data", "type": "bytes"} ]
> }
> The toString()  
>       System.out.println(new ByteArrayEncoding(ByteBuffer.wrap(new 
> byte[]{0,31,65,66,67,(byte)255,(byte)182})));
> Returns raw bytes to string in the json :
> {"data": {"bytes": "  ABC??"}}
> As a byte array is not tied to be a valid string, it should be converted back 
> and forth to Base64 like other Json implementations : 
> {"data": {"bytes": "AB9BQkP/tg=="}}



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

Reply via email to