JBBPBitInputStream extends FilterInputStream implements JBBPCountableBitStream { public double readDouble(final JBBPByteOrder byteOrder) throws IOException { final long value; if (byteOrder == JBBPByteOrder.BIG_ENDIAN) { value = (((long) readInt(byteOrder) & 0xFFFFFFFFL) << 32) | ((long) readInt(byteOrder) & 0xFFFFFFFFL); } else { value = ((long) readInt(byteOrder) & 0xFFFFFFFFL) | (((long) readInt(byteOrder) & 0xFFFFFFFFL) << 32); } return Double.longBitsToDouble(value); } JBBPBitInputStream(final InputStream in);  JBBPBitInputStream(final InputStream in, final JBBPBitOrder order); boolean[] readBoolArray(final int items); byte[] readBitsArray(final int items, final JBBPBitNumber bitNumber); byte[] readByteArray(final int items); byte[] readByteArray(final int items, final JBBPByteOrder byteOrder); short[] readShortArray(final int items, final JBBPByteOrder byteOrder); char[] readUShortArray(final int items, final JBBPByteOrder byteOrder); int[] readIntArray(final int items, final JBBPByteOrder byteOrder); float[] readFloatArray(final int items, final JBBPByteOrder byteOrder); long[] readLongArray(final int items, final JBBPByteOrder byteOrder); double[] readDoubleArray(final int items, final JBBPByteOrder byteOrder); int readUnsignedShort(final JBBPByteOrder byteOrder); int readInt(final JBBPByteOrder byteOrder); float readFloat(final JBBPByteOrder byteOrder); long readLong(final JBBPByteOrder byteOrder); double readDouble(final JBBPByteOrder byteOrder); @Override long getCounter(); @Override int getBitBuffer(); @Override int getBufferedBitsNumber(); @Override JBBPBitOrder getBitOrder(); byte readBitField(final JBBPBitNumber numOfBitsToRead); int readBits(final JBBPBitNumber numOfBitsToRead); boolean readBoolean(); int readByte(); @Override synchronized void reset(); @Override synchronized void mark(final int readlimit); void align(final long alignByteNumber); @Override long skip(final long numOfBytes); void alignByte(); boolean hasAvailableData(); @SuppressWarnings("NullableProblems") @Override int read(final byte[] array, final int offset, final int length); @Override void resetCounter(); @SuppressWarnings("NullableProblems") @Override int read(final byte[] array); @Override int read(); String readString(final JBBPByteOrder byteOrder); String[] readStringArray(final int items, final JBBPByteOrder byteOrder);  }
@Test public void testReadDouble_BigEndian() throws Exception { assertEquals(5.626349538661693E-221d, asInputStream(0x12, 0x34, 0x56, 0x78, 0xAA, 0xBB, 0xCC, 0xDD).readDouble(JBBPByteOrder.BIG_ENDIAN), TestUtils.FLOAT_DELTA); }
@Test public void testReadDouble_BigEndian_EOF() throws Exception { assertThrows(EOFException.class, () -> asInputStream(0x12, 0x34, 0x56, 0x78, 0xAA, 0xBB, 0xCC).readDouble(JBBPByteOrder.BIG_ENDIAN)); }
@Test public void testReadDouble_LittleEndian() throws Exception { assertEquals(-7.00761088740633E143d, asInputStream(0x12, 0x34, 0x56, 0x78, 0xAA, 0xBB, 0xCC, 0xDD).readDouble(JBBPByteOrder.LITTLE_ENDIAN), TestUtils.FLOAT_DELTA); }
@Test public void testReadDouble_LittleEndian_EOF() throws Exception { assertThrows(EOFException.class, () -> asInputStream(0x12, 0x34, 0x56, 0x78, 0xAA, 0xBB, 0xCC).readDouble(JBBPByteOrder.LITTLE_ENDIAN)); }