question: public static double bytesToDouble ( byte [ ] b ) { if ( b == null ) { return Double . NaN ; } DataInputStream dis = new DataInputStream ( new ByteArrayInputStream ( b ) ) ; try { if ( b . length == 4 ) { return dis . readFloat ( ) ; } else { return dis . readDouble ( ) ; } } catch ( IOException bad ) { return Double . NaN ; } }
target:  Decodes byte array to a double value.