Why am I getting garbage out of the following function?
The incoming _data argument is byte[] = {6D, F3, B4, 15}
The _endian argument is ByteOrder.ByteOrder.LITTLE_ENDIAN
ByteBuffer m_ByteBuffer;
public static double ByteToDouble(byte[] _data, int offset, ByteOrder _endian){
synchronized (m_ByteBuffer) {
m_ByteBuffer.clear();
m_ByteBuffer.order(_endian);
m_ByteBuffer.position(0);
m_ByteBuffer.get(_data);
m_ByteBuffer.position(0);
}
return m_ByteBuffer.getDouble();
}