J
JohnShade
sorry for my bad english
i ve array of bytes, byte[] data
i wanna put an int into this array on some arbitrary position
how is the better way to do this?
in this moment i only can do some thing like that
int pos=17;
int myintval = 0xaabbccdd;
data[pos+0]= (byte) (myintva>>24)%256;
data[pos+1]= (byte) (myintva>>16)%256;
data[pos+2]= (byte) (myintva>>8)%256;
data[pos+3]= (byte) (myintva>>0)%256;
i ve array of bytes, byte[] data
i wanna put an int into this array on some arbitrary position
how is the better way to do this?
in this moment i only can do some thing like that
int pos=17;
int myintval = 0xaabbccdd;
data[pos+0]= (byte) (myintva>>24)%256;
data[pos+1]= (byte) (myintva>>16)%256;
data[pos+2]= (byte) (myintva>>8)%256;
data[pos+3]= (byte) (myintva>>0)%256;