private static double byteArrayToDouble(byte[] bytes) {
double d = 0.0;
ByteBuffer.wrap(bytes).putDouble(d);
return d;
}
That's a strange way to convert a byte array to a double. It doesn't do anything to the double. It can't. No reference parameters in Java. It should be get. Essentially the whole method can be replaced with:
ByteBuffer.wrap(request.getData(), 0, request.getLength()).getDouble().
E&OE