[
http://jira.jboss.com/jira/browse/JBCACHE-1289?page=comments#action_12398956 ]
Manik Surtani commented on JBCACHE-1289:
----------------------------------------
Yes, of course. Ok, checked in now.
VersionAwareMarshalle.objectFromStream implemention uses unreliable
InputStream.available
-----------------------------------------------------------------------------------------
Key: JBCACHE-1289
URL:
http://jira.jboss.com/jira/browse/JBCACHE-1289
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Reporter: Elias Ross
Assigned To: Manik Surtani
InputStream.available() may return less than the complete number of bytes available on
the stream. The following does not work:
@Override
public Object objectFromStream(InputStream is) throws Exception
{
int avbl = is.available(); // MAY RETURN 1 !
byte[] bytes = new byte[avbl];
is.read(bytes, 0, avbl);
return objectFromByteBuffer(bytes);
}
I want to be able to stream objects from the Amazon S3 service. The following does not
work either:
ObjectInputStream ois = new MarshalledValueInputStream(is);
short versionId = ois.readShort();
Marshaller marshaller = getMarshaller(versionId);
return marshaller.objectFromObjectStream(ois);
I'm guessing ReusableObjectInputStream needs to be used and changed to actually
support streams, not byte arrays! But I'm not too familiar with the mechanics.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira