Re: Can a FastWriter ever be recycled in the current model?

Keats Kirsch <[email protected]> Thu, 16 Mar 2006 11:18:57 -0500
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
Alex Twisleton-Wykeham-Fiennes wrote:

>... obvious to remove is 
>the ByteBufferOutputStream.reset() which currently is implemented as:-
>
>  /**
>   * Clear the contents of the byte buffer.  Also shrinks the byte buffer
>   * to the size specified during construction of this ByteBufferOutputStream
>   */
>  public void reset ()
>  {
>      _pos = 0;
>      _buf = new byte[_initialSize];
>  }
>
>This is currently (in my testbed) only ever getting invoked during:-
>
>	ByteBufferOutputStream.reset()
>  
>
[I assume this is a typo and it doesn't actually call itself. ]

>	FastWriter.flush()
>  
>
I agree that this shouldn't re-allocate.

>	FastWriter.close()
>  
>
No sense allocating on a close.

>	WMTemplate.evaluateAsBytes()
>  
>
I'm not quite sure why this would reset anything.  It seems like you 
should explicitly flush or close after evaluating if you want to.

Keats




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642