Package co.nstant.in.cbor.encoder

Examples of co.nstant.in.cbor.encoder.HalfPrecisionFloatEncoder.encode()


  private boolean isHalfPrecisionEnough(float value) {
    try {
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      HalfPrecisionFloatEncoder encoder = new HalfPrecisionFloatEncoder(
          null, outputStream);
      encoder.encode(new HalfPrecisionFloat(value));
      ByteArrayInputStream inputStream = new ByteArrayInputStream(
          outputStream.toByteArray());
      HalfPrecisionFloatDecoder decoder = new HalfPrecisionFloatDecoder(
          null, inputStream);
      HalfPrecisionFloat halfPrecisionFloat = decoder.decode(0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.