Package co.nstant.in.cbor.encoder

## Class HalfPrecisionFloatEncoder

- java.lang.Object
- - co.nstant.in.cbor.encoder.AbstractEncoder<HalfPrecisionFloat>
  - - co.nstant.in.cbor.encoder.HalfPrecisionFloatEncoder

-     public class HalfPrecisionFloatEncoder
      extends AbstractEncoder<HalfPrecisionFloat>

- - ### Field Summary

    - ### Fields inherited from class co.nstant.in.cbor.encoder.AbstractEncoder

      `encoder`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `HalfPrecisionFloatEncoder​(CborEncoder encoder, OutputStream outputStream)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `encode​(HalfPrecisionFloat dataItem)` |
    `static int` | `fromFloat​(float fval)` |

    - ### Methods inherited from class co.nstant.in.cbor.encoder.AbstractEncoder

      `encodeTypeAndLength, encodeTypeAndLength, encodeTypeChunked, write, write`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HalfPrecisionFloatEncoder

          public HalfPrecisionFloatEncoder​(CborEncoder encoder,
                                           OutputStream outputStream)

  - ### Method Detail

    - #### encode

          public void encode​(HalfPrecisionFloat dataItem)
                      throws CborException

      Specified by:
        `encode` in class `AbstractEncoder<HalfPrecisionFloat>`
      Throws:
        `CborException`

    - #### fromFloat

          public static int fromFloat​(float fval)

      Parameters:
        `fval` - the float value
      Returns:
        all higher 16 bits as 0 for all results
      See Also:
        Stack Overflow