Investigate use of ExposedBAOS instead of BAOS when marshalling objects
-----------------------------------------------------------------------
Key: JBCACHE-1382
URL:
http://jira.jboss.com/jira/browse/JBCACHE-1382
Project: JBoss Cache
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Manik Surtani
Assigned To: Manik Surtani
Fix For: 2.2.0.GA, 3.0.0
From Bela's email:
"At least in AbstractMarshaller:
public byte[] objectToByteBuffer(Object obj) throws Exception
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = ObjectSerializationFactory.createObjectOutputStream(baos);
objectToObjectStream(obj, out);
out.close();
return baos.toByteArray();
}
Here, an ExposedByteArrayOutputStream instead of a BAOS would prevent the COPY of the byte
buffer. We also don't need to be concerned about reentrancy as the output streams are
local (stack) variables...
Maybe you guys should take a look at all occurrences of BAOS !"
--
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