Java Code Examples for co.nstant.in.cbor.model.SimpleValue#TRUE
The following examples show how to use
co.nstant.in.cbor.model.SimpleValue#TRUE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SpecialDecoder.java From cbor-java with Apache License 2.0 | 5 votes |
@Override public Special decode(int initialByte) throws CborException { switch (SpecialType.ofByte(initialByte)) { case BREAK: return Special.BREAK; case SIMPLE_VALUE: switch (SimpleValueType.ofByte(initialByte)) { case FALSE: return SimpleValue.FALSE; case TRUE: return SimpleValue.TRUE; case NULL: return SimpleValue.NULL; case UNDEFINED: return SimpleValue.UNDEFINED; case UNALLOCATED: return new SimpleValue(initialByte & 31); case RESERVED: default: throw new CborException("Not implemented"); } case IEEE_754_HALF_PRECISION_FLOAT: return halfPrecisionFloatDecoder.decode(initialByte); case IEEE_754_SINGLE_PRECISION_FLOAT: return singlePrecisionFloatDecoder.decode(initialByte); case IEEE_754_DOUBLE_PRECISION_FLOAT: return doublePrecisionFloatDecoder.decode(initialByte); case SIMPLE_VALUE_NEXT_BYTE: return new SimpleValue(nextSymbol()); case UNALLOCATED: default: throw new CborException("Not implemented"); } }
Example 2
Source File: AbstractBuilder.java From cbor-java with Apache License 2.0 | 5 votes |
protected DataItem convert(boolean value) { if (value) { return SimpleValue.TRUE; } else { return SimpleValue.FALSE; } }