S
stingar
help me!
stingar said:help me!
public class X
{
public static void main(String[] args) throws IOException
{
long l = 314159265L;
ByteArrayOutputStream baos = new ByteArrayOutputStream(8);
DataOutputStream dos = new DataOutputStream(baos);
dos.writeLong(l);
byte[] bytes = baos.toByteArray();
for(byte b : bytes)
{
System.out.println(b);
}
stingar said:help me!
Ferenc Hechler said:I don't think it can be done by a simple cast,
because the byte represantation of a long is system
dependant (little-endian, big-endian).
xarax said:Totally wrong on the Endian thing. Java is
ALWAYS big endian.
xarax said:Totally wrong on the Endian thing. Java is
ALWAYS big endian.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.