]
Dan Berindei updated ISPN-7784:
-------------------------------
Summary: BytesObjectInput doesn't implement ObjectInput properly (was:
BytesObjectInput doesn't implement DataInput properly)
BytesObjectInput doesn't implement ObjectInput properly
-------------------------------------------------------
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()}}.