Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

place a string in a bytebuffer?

Thread view: 
nooneinparticular314159@yahoo.com - 16 Feb 2006 04:10 GMT
I'm trying to get a string into a bytebuffer, and I'm having a lot of
trouble doing so.

I've tried to convert it to a chararray using getchars, but without
success.

I've tried to convert it to a stringbuffer, and I've tried getBytes,
but nothing seems to give me a new object that
actually contains the original string, or something that I can convert
back into teh original string.  Any idea what I'm doing wrong?  How can
I get a string into a bytebuffer?

Thanks!
IchBin - 16 Feb 2006 05:50 GMT
> I'm trying to get a string into a bytebuffer, and I'm having a lot of
> trouble doing so.
[quoted text clipped - 9 lines]
>
> Thanks!

Look at the 'The Java Developers Almanac 1.4' for bytebuffer examples.
http://javaalmanac.com/egs/java.nio/PutString.html?l=rel
Signature


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)

Roedy Green - 17 Feb 2006 06:25 GMT
On 15 Feb 2006 20:10:12 -0800, "nooneinparticular314159@yahoo.com"
<nooneinparticular314159@yahoo.com> wrote, quoted or indirectly quoted
someone who said :

>I'm trying to get a string into a bytebuffer, and I'm having a lot of
>trouble doing so.
>
>I've tried to convert it to a chararray using getchars, but without
>success.

for String <-> byte[] <-> char[] conversion problems, see
http://mindprod.com/jgloss/conversion.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.