hallo zusammen,
ich möchte einen byte[8] array in double konvertieren.
ich habe eine funktion für long gefunden aber ich weiss nicht wie ich sie für double anpasse .
funktion bytesTolong :
long bytesTolong(byte[])
{
int i;
long val = 0;
int bits = 64;
long tval;
for(i=8; i-- \> 0:wink:
{
bits -= 8;
tval = b[i];
tval = tval
ich habe auch die funktionen von java.nio verwendet aber bekomme ich das nicht hin
ByteBuffer bb = ByteBuffer.wrap(b) // b byte array
//bb.order(ByteOrder.LITTLE\_ENDIAN)
double d = bb.getDouble();
Java Code:
ByteBuffer bb = ByteBuffer.wrap(b) // b byte array
//bb.order(ByteOrder.LITTLE\_ENDIAN)
double d = bb.getDouble();
weiss jemand rat ?
danke im voraus
youssef