@Test public void testCreateReadAnyFirstBinaryWire() throws Exception { final Bytes<ByteBuffer> bytes = Bytes.elasticByteBuffer(); final String expected = "world"; BINARY.apply(bytes).write((() -> "hello")).text(expected); Assert.assertEquals(expected, READ_ANY.apply(bytes).read((() -> "hello")).text()); }
public static PropertyDataTypes getTypeByTypeNum(int typeNum) { if (STRING.getTypeNum() == typeNum) return STRING; else if (BINARY.getTypeNum() == typeNum) return BINARY; else if (LONG.getTypeNum() == typeNum) return LONG; else if (DOUBLE.getTypeNum() == typeNum) return DOUBLE; else if (DATE.getTypeNum() == typeNum) return DATE; else if (BOOLEAN.getTypeNum() == typeNum) return BOOLEAN; else if (NAME.getTypeNum() == typeNum) return NAME; else if (PATH.getTypeNum() == typeNum) return PATH; else if (REFERENCE.getTypeNum() == typeNum) return REFERENCE; else if (WEAKREFERENCE.getTypeNum() == typeNum) return WEAKREFERENCE; else if (URI.getTypeNum() == typeNum) return URI; else if (DECIMAL.getTypeNum() == typeNum) return DECIMAL; else return UNDEFINED; }