[jboss-jira] [JBoss JIRA] Commented: (JBCACHE-1382) Investigate use of ExposedBAOS instead of BAOS when marshalling objects

Manik Surtani (JIRA) jira-events at lists.jboss.org
Tue Jul 15 09:07:26 EDT 2008


    [ http://jira.jboss.com/jira/browse/JBCACHE-1382?page=comments#action_12421344 ] 
            
Manik Surtani commented on JBCACHE-1382:
----------------------------------------

See discussion on this thread: http://lists.jboss.org/pipermail/jbosscache-dev/2008-July/002359.html

> 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: 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

        



More information about the jboss-jira mailing list