instead?
thanks that's work for me...
but the result is in decimal...
can you give me a hint how to get the result in hex like [0b,27,00,00]
i try code like this
Expand
|
Select
|
Wrap
|
Line Numbers
ByteBuffer bb = ByteBuffer.allocate(4);
bb.order(ByteOrder.LITTLE_ENDIAN);
bb.putInt(9995);
//bb.putInt(43690);
String xx = Arrays.toString(bb.array());
String yy;
yy = xx.substring(1,3);
int i = Integer.parseInt(yy);
String hex1 = Integer.toHexString(i);
System.out.println("Hexa : " + hex1);
the result is "Hexa : b" not "Hexa : 0B"
the code has problem when put integer 43690(0xAAAA in hex) the result in array is [-86, -86, 0, 0] -86 when convert in java the result is
ffffffAA
not
AA