protected double grabDouble ( byte [ ] bytes , int offset ) throws DescriptorException { try { byte [ ] src ; if ( littleEndianData ) { src = new byte [ 8 ] ; src [ 0 ] = bytes [ offset + 7 ] ; src [ 1 ] = bytes [ offset + 6 ] ; src [ 2 ] = bytes [ offset + 5 ] ; src [ 3 ] = bytes [ offset + 4 ] ; src [ 4 ] = bytes [ offset + 3 ] ; src [ 5 ] = bytes [ offset + 2 ] ; src [ 6 ] = bytes [ offset + 1 ] ; src [ 7 ] = bytes [ offset ] ; offset = 0 ; } else { src = bytes ; } DataInputStream stream = new DataInputStream ( new ByteArrayInputStream ( src , offset , 8 ) ) ; return stream . readDouble ( ) ; } catch ( Exception ex ) { throw new DescriptorException ( ex ) ; } }
Unpack an eight - byte IEEE float from the given byte array .