double readDoubleLittleEndian( ) { long accum = 0; for ( int shiftBy=0; shiftBy<64; shiftBy+=8 ) { // must cast to long or shift done modulo 32 accum |= ( (long)( readByte() & 0xff ) ) << shiftBy; } return Double.longBitsToDouble( accum ); // there is no such method as Double.reverseBytes( d ); }