@Override public void convertFloat(FloatPointable floatp, DataOutput dOut) throws SystemException, IOException { float floatValue = floatp.getFloat(); if (Float.isInfinite(floatValue) || Float.isNaN(floatValue)) { throw new SystemException(ErrorCode.FOCA0002); } if (floatValue > Byte.MAX_VALUE || floatValue < Byte.MIN_VALUE) { throw new SystemException(ErrorCode.FOCA0003); } if (floatp.byteValue() < 0 && !negativeAllowed) { throw new SystemException(ErrorCode.FORG0001); } dOut.write(returnTag); dOut.write(floatp.byteValue()); }
@Override public void convertFloat(FloatPointable floatp, DataOutput dOut) throws SystemException, IOException { float floatValue = floatp.getFloat(); if (Float.isInfinite(floatValue) || Float.isNaN(floatValue)) { throw new SystemException(ErrorCode.FOCA0002); } if (floatValue > Integer.MAX_VALUE || floatValue < Integer.MIN_VALUE) { throw new SystemException(ErrorCode.FOCA0003); } if (floatp.byteValue() < 0 && !negativeAllowed) { throw new SystemException(ErrorCode.FORG0001); } dOut.write(returnTag); dOut.writeInt(floatp.intValue()); }
@Override public void convertFloat(FloatPointable floatp, DataOutput dOut) throws SystemException, IOException { float floatValue = floatp.getFloat(); if (Float.isInfinite(floatValue) || Float.isNaN(floatValue)) { throw new SystemException(ErrorCode.FOCA0002); } if (floatValue > Short.MAX_VALUE || floatValue < Short.MIN_VALUE) { throw new SystemException(ErrorCode.FOCA0003); } if (floatp.byteValue() < 0 && !negativeAllowed) { throw new SystemException(ErrorCode.FORG0001); } dOut.write(returnTag); dOut.writeShort(floatp.shortValue()); }