aspose file tools*
The moose likes Java in General and the fly likes how to put an object into ByteBuffer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to put an object into ByteBuffer" Watch "how to put an object into ByteBuffer" New topic
Author

how to put an object into ByteBuffer

tanshu sharma
Greenhorn

Joined: Mar 09, 2013
Posts: 4
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

Joined: Mar 17, 2011
Posts: 7779
    
  21

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

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to put an object into ByteBuffer