[164] in java-interest
int -> bytes
daemon@ATHENA.MIT.EDU (Peter Parnes)
Wed May 31 18:08:46 1995
To: java-interest@java.Eng.Sun.COM
Date: Wed, 31 May 1995 23:43:04 +0200
From: Peter Parnes <peppar@cdt.luth.se>
Hi
How do you code the following in Java?
---
byte b[sizeof(i)];
int i[1];
memcpy((void *)b, (void *)i,sizeof(i));
---
where byte is the Java-byte type.
I need to change an array of ints into bytes to be able to send it over the
network and on the receiving side change it back into ints. I've tried to use
arraycopy+casting whitout success.
/Peppar
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com