Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

"reuse of buffer"

807597Aug 2 2005 — edited Feb 8 2009
Hello

I have initialise a byte buffer in my program and allocate memory to it like the following:

byte[] buffer = new byte[100]

In the middle of the program I am making this buffer null

buffer = null;

I want to know can i reuse this buffer without allocating memory to it by new. I do not want to do new everytime

Is there any other method that can make this buffer empty(Basically i want to do this only)

Please help

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2009
Added on Aug 2 2005
5 comments
361 views