Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to put an object into ByteBuffer

 
tanshu sharma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hii..every one...
can anybody please help me...in putting the Message object into a byteBuffer...



now the problem is..how to retrieve Msg1 from String...
otherwise how to sent it directly in bytes....

its..extremly urgent.......
thanks in advance.....
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its..extremly urgent.......

Well, I'm afraid that's your problem, not ours, so EaseUp (←click).

tanshu sharma wrote:now the problem is..how to retrieve Msg1 from String...

Answer: with difficulty, because StringsAreBad (←click).

otherwise how to sent it directly in bytes....

I suggest you have a look at all those put...() methods in ByteBuffer, and think how you might use them.

I'd also suggest that you think about driving this from your Message class, rather than from outside it. For example, what about amethod?

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic