[infinispan-issues] [JBoss JIRA] (ISPN-7784) BytesObjectInput.read() throws ArrayIndexOutOfBoundsException at the end

Dan Berindei (JIRA) issues at jboss.org
Wed May 3 11:41:00 EDT 2017


    [ https://issues.jboss.org/browse/ISPN-7784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401464#comment-13401464 ] 

Dan Berindei commented on ISPN-7784:
------------------------------------

{{BytesObjectInput#readByte()}} is also incorrect, it should throw {{EOFException}} at the end of the buffer but it throws the same {{ArrayIndexOutOfBoundsException}}.

> BytesObjectInput.read() throws ArrayIndexOutOfBoundsException at the end
> ------------------------------------------------------------------------
>
>                 Key: ISPN-7784
>                 URL: https://issues.jboss.org/browse/ISPN-7784
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 9.0.0.Final
>            Reporter: Dan Berindei
>            Assignee: Dan Berindei
>             Fix For: 9.1.0.Final
>
>
> The {{java.io.ObjectInput#read()}} javadoc says implementations should return -1 if the end of the stream is reached, but {{BytesObjectInput}} throws an {{ArrayIndexOutOfBoundsException}}.
> Actually, {{read()}} is only used because {{ExternalJBossMarshaller.JBossByteInput}} doesn't implement {{read(byte[])}}. This makes unmarshalling of external objects slower than it should be, because {{InputStream.read(byte[])}} fills the buffer by repeatedly calling {{read()}}.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the infinispan-issues mailing list