This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Bytebuffer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Bytebuffer" Watch "Bytebuffer" New topic


chella adisesh

Joined: Oct 10, 2003
Posts: 7
How do we convert a bytebuffer to an string.
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Something like this:


The latter is a little more efficient if you reuse the decoder. Of course, replace UTF-8 with whatever encoding is appropriate for your application.

"I'm not back." - Bill Harding, Twister
chella adisesh

Joined: Oct 10, 2003
Posts: 7
Thank you very much. I have run into a problem in my program which i did not see it coming. Actually the program wants to convert a string into a byte buffer.
Any pointers will be appreciated.
I agree. Here's the link:
subject: Bytebuffer
It's not a secret anymore!