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
Daniel Webe #2 / 3
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
Mike Brow #3 / 3
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.