You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Scott Carey (JIRA)" <ji...@apache.org> on 2011/01/19 09:48:44 UTC

[jira] Updated: (AVRO-738) BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter

     [ https://issues.apache.org/jira/browse/AVRO-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Carey updated AVRO-738:
-----------------------------

         Priority: Critical  (was: Major)
    Fix Version/s: 1.5.0

This looks like a relatively crirical bug.

BinaryEncoder is not clearing out its byteWriter state when initialized with a new output stream.

In general it seems like there are several performance enhancements to be had as well -- access to the outputStream is too fine-grained.

As a work-around use the 

{code}
  public void writeBytes(byte[] bytes, int start, int len) throws IOException
{code}

signature instead of

{code}
  public void writeBytes(ByteBuffer bytes) throws IOException
{code}

That should avoid this bug.

> BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter
> ------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-738
>                 URL: https://issues.apache.org/jira/browse/AVRO-738
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.1
>            Reporter: Devajyoti Sarkar
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> This is a problem if one is trying to reuse the BinaryEncoder by passing a new OutputStream with the init() method. While the encoder will write all the fields to the new OutputStream, fields that are of type "bytes" do not get written. This effectively means that one needs to create a new BinaryEncoder each time if one is serializing record with a "bytes" field in it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.