[infinispan-issues] [JBoss JIRA] (IPROTO-129) ProtobufUtil.fromWrappedByteArray should not create a ByteArrayInputStream

Dan Berindei (Jira) issues at jboss.org
Mon Jan 27 15:51:18 EST 2020


     [ https://issues.redhat.com/browse/IPROTO-129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Berindei updated IPROTO-129:
--------------------------------
              Status: Pull Request Sent  (was: Open)
    Git Pull Request: https://github.com/infinispan/protostream/pull/89


> ProtobufUtil.fromWrappedByteArray should not create a ByteArrayInputStream
> --------------------------------------------------------------------------
>
>                 Key: IPROTO-129
>                 URL: https://issues.redhat.com/browse/IPROTO-129
>             Project: Infinispan ProtoStream
>          Issue Type: Bug
>    Affects Versions: 4.3.2.Final
>            Reporter: Dan Berindei
>            Assignee: Dan Berindei
>            Priority: Major
>
> {{ProtobufUtil.fromWrappedByteArray}} wraps the {{bytep[]}} in a {{ByteArrayInputStream}} and uses that as an input for {{CodedInputStream}}. But that is inefficient, because {{CodedInputStream.StreamDecoder}} needs to allocate a buffer and copy from the stream into the buffer before processing. 
> Instead we can pass the {{byte[]}} directly to {{CodedInputStream}} and use {{CodedInputStream.ArrayDecoder}}, which doesn't need a buffer.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the infinispan-issues mailing list