@Test public void testReadSwappedDouble() throws IOException { final byte[] bytes = new byte[] { 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01 }; final double d1 = Double.longBitsToDouble( 0x0102030405060708L ); final double d2 = EndianUtils.readSwappedDouble( bytes, 0 ); assertEquals( d1, d2, 0.0 ); final ByteArrayInputStream input = new ByteArrayInputStream(bytes); assertEquals( d1, EndianUtils.readSwappedDouble( input ), 0.0 ); }
public static double readSwappedDouble(final byte[] data, final int offset) { return Double.longBitsToDouble( readSwappedLong( data, offset ) ); }
EndianUtils { public static double readSwappedDouble(final byte[] data, final int offset) { return Double.longBitsToDouble( readSwappedLong( data, offset ) ); } }
EndianUtils { public static double readSwappedDouble(final byte[] data, final int offset) { return Double.longBitsToDouble( readSwappedLong( data, offset ) ); } EndianUtils(); }
EndianUtils { public static double readSwappedDouble(final byte[] data, final int offset) { return Double.longBitsToDouble( readSwappedLong( data, offset ) ); } EndianUtils(); static short swapShort(final short value); static int swapInteger(final int value); static long swapLong(final long value); static float swapFloat(final float value); static double swapDouble(final double value); static void writeSwappedShort(final byte[] data, final int offset, final short value); static short readSwappedShort(final byte[] data, final int offset); static int readSwappedUnsignedShort(final byte[] data, final int offset); static void writeSwappedInteger(final byte[] data, final int offset, final int value); static int readSwappedInteger(final byte[] data, final int offset); static long readSwappedUnsignedInteger(final byte[] data, final int offset); static void writeSwappedLong(final byte[] data, final int offset, final long value); static long readSwappedLong(final byte[] data, final int offset); static void writeSwappedFloat(final byte[] data, final int offset, final float value); static float readSwappedFloat(final byte[] data, final int offset); static void writeSwappedDouble(final byte[] data, final int offset, final double value); static double readSwappedDouble(final byte[] data, final int offset); static void writeSwappedShort(final OutputStream output, final short value); static short readSwappedShort(final InputStream input); static int readSwappedUnsignedShort(final InputStream input); static void writeSwappedInteger(final OutputStream output, final int value); static int readSwappedInteger(final InputStream input); static long readSwappedUnsignedInteger(final InputStream input); static void writeSwappedLong(final OutputStream output, final long value); static long readSwappedLong(final InputStream input); static void writeSwappedFloat(final OutputStream output, final float value); static float readSwappedFloat(final InputStream input); static void writeSwappedDouble(final OutputStream output, final double value); static double readSwappedDouble(final InputStream input); }
EndianUtils { public static double readSwappedDouble(final byte[] data, final int offset) { return Double.longBitsToDouble( readSwappedLong( data, offset ) ); } EndianUtils(); static short swapShort(final short value); static int swapInteger(final int value); static long swapLong(final long value); static float swapFloat(final float value); static double swapDouble(final double value); static void writeSwappedShort(final byte[] data, final int offset, final short value); static short readSwappedShort(final byte[] data, final int offset); static int readSwappedUnsignedShort(final byte[] data, final int offset); static void writeSwappedInteger(final byte[] data, final int offset, final int value); static int readSwappedInteger(final byte[] data, final int offset); static long readSwappedUnsignedInteger(final byte[] data, final int offset); static void writeSwappedLong(final byte[] data, final int offset, final long value); static long readSwappedLong(final byte[] data, final int offset); static void writeSwappedFloat(final byte[] data, final int offset, final float value); static float readSwappedFloat(final byte[] data, final int offset); static void writeSwappedDouble(final byte[] data, final int offset, final double value); static double readSwappedDouble(final byte[] data, final int offset); static void writeSwappedShort(final OutputStream output, final short value); static short readSwappedShort(final InputStream input); static int readSwappedUnsignedShort(final InputStream input); static void writeSwappedInteger(final OutputStream output, final int value); static int readSwappedInteger(final InputStream input); static long readSwappedUnsignedInteger(final InputStream input); static void writeSwappedLong(final OutputStream output, final long value); static long readSwappedLong(final InputStream input); static void writeSwappedFloat(final OutputStream output, final float value); static float readSwappedFloat(final InputStream input); static void writeSwappedDouble(final OutputStream output, final double value); static double readSwappedDouble(final InputStream input);  }