@Override public long getAsInvertedBitOrder() { return reverseBits(this.value); }
@Override public long getAsInvertedBitOrder() { return JBBPFieldInt.reverseBits(Float.floatToIntBits(this.value)); }
@Override public Object getValueArrayAsObject(final boolean reverseBits) { final float[] result; if (reverseBits) { result = this.array.clone(); for (int i = 0; i < result.length; i++) { result[i] = Float.intBitsToFloat((int) JBBPFieldInt.reverseBits(Float.floatToIntBits(result[i]))); } } else { result = this.array.clone(); } return result; }
@Override public Object getValueArrayAsObject(final boolean reverseBits) { final int[] result; if (reverseBits) { result = this.array.clone(); for (int i = 0; i < result.length; i++) { result[i] = (int) JBBPFieldInt.reverseBits(result[i]); } } else { result = this.array.clone(); } return result; }
/** * Print float value. * * @param value float value to be printed * @return the context * @throws IOException it will be thrown for transport errors * @since 1.4.0 */ public JBBPTextWriter Float(final float value) throws IOException { ensureValueMode(); String convertedByExtras = null; for (final Extra e : this.extras) { convertedByExtras = e.doConvertFloatToStr(this, value); if (convertedByExtras != null) { break; } } if (convertedByExtras == null) { final float valueToWrite; if (this.byteOrder == JBBPByteOrder.LITTLE_ENDIAN) { valueToWrite = Float.intBitsToFloat((int) JBBPFieldInt.reverseBits(Float.floatToIntBits(value))); } else { valueToWrite = value; } printValueString(JBBPUtils.ensureMinTextLength(JBBPUtils.float2str(valueToWrite, this.radix), this.maxCharsRadixForShort, '0', 0)); } else { printValueString(convertedByExtras); } return this; }
value = ((Number) readFieldValue(obj, field)).intValue(); if (reverseBits) { value = (int) JBBPFieldInt.reverseBits(value); value = Float.intBitsToFloat((int) JBBPFieldInt.reverseBits(Float.floatToIntBits(value))); float value = Array.getFloat(array, i); if (reverseBits) { value = Float.intBitsToFloat((int) JBBPFieldInt.reverseBits(Float.floatToIntBits(value))); int value = ((Number) Array.get(array, i)).intValue(); if (reverseBits) { value = (int) JBBPFieldInt.reverseBits(value);