public static double parseDouble(byte[] bytes,int startIndex,int endIndex){
  if (endIndex - startIndex == 8) {
    return Double.longBitsToDouble(parseLong(bytes,startIndex,endIndex));
  }
 else   if (endIndex - startIndex == 4) {
    return Float.intBitsToFloat((int)parseLong(bytes,startIndex,endIndex));
  }
 else {
    throw new IllegalArgumentException("endIndex (" + endIndex + ") - startIndex ("+ startIndex+ ") != 4 or 8");
  }
}

public static double parseDouble ( byte [ ] bytes , int startIndex , int endIndex ) { if ( endIndex - startIndex == 8 ) { return Double . longBitsToDouble ( parseLong ( bytes , startIndex , endIndex ) ) ; } else if ( endIndex - startIndex == 4 ) { return Float . intBitsToFloat ( ( int ) parseLong ( bytes , startIndex , endIndex ) ) ; } else { throw new IllegalArgumentException ( "endIndex (" + endIndex + ") - startIndex (" + startIndex + ") != 4 or 8" ) ; } }
parses a double from a ( big - endian ) byte array .
