newbie: int->byte[]->int? 
Author Message
 newbie: int->byte[]->int?

Hi,  I'd like to send an int over a socket.  How can I convert int to byte[]
and then back?  I'm looking for something similar to ByteBuffer.putInt and
ByteBuffer.getInt in Java.

Thanks for any help,
Mike



Fri, 15 Oct 2004 02:40:00 GMT  
 newbie: int->byte[]->int?
Try BitConverter class.

BitConverter.GetBytes() (must have 1000 overloads).



Quote:
> Hi,  I'd like to send an int over a socket.  How can I convert int to
byte[]
> and then back?  I'm looking for something similar to ByteBuffer.putInt and
> ByteBuffer.getInt in Java.

> Thanks for any help,
> Mike



Fri, 15 Oct 2004 04:01:28 GMT  
 newbie: int->byte[]->int?
Thanks!  That's exactly what I was looking for.


Quote:
> Try BitConverter class.

> BitConverter.GetBytes() (must have 1000 overloads).



> > Hi,  I'd like to send an int over a socket.  How can I convert int to
> byte[]
> > and then back?  I'm looking for something similar to ByteBuffer.putInt
and
> > ByteBuffer.getInt in Java.

> > Thanks for any help,
> > Mike



Fri, 15 Oct 2004 05:21:57 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. negative int => positive int

2. BUG?: vector <int,allocator<int>> compiler whitespace error [newbie BEGS your help!]

3. BUG?: vector <int,allocator<int>> compiler whitespace error [newbie BEGS your help!]

4. int func(int) versus int func(int *) efficacy.

5. newbie question >>>

6. Another newbie Q...int ** and int [][]

7. String -> Int and Int -> String

8. (int/int) != int

9. Calling int f(int (*f)(int)) like function in DLL from VB

10. How to do int func(int size,int matrix[][size])

11. B>C>C++>VC++(MFC)>RAW API PROGRAMMING>ATL>COM>OLE>ADO>ASP.............

12. >>>>>>>>> What would you like in a debugger?

 

 
Powered by phpBB® Forum Software