File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 7518
    
  18

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to put an object into ByteBuffer
 
Similar Threads
How to receive message after sending from client side ?
Data Type Conversion Just beginning
sockets and threads
what is a lightweight way to convert double or integers to byte arrays in Java
Java Mail not sending emails when using from WAN