TLV { public static TLV decodeFromByteArray(byte[] inputBytes) throws Exception { ByteArrayInputStream bin = new ByteArrayInputStream(inputBytes); return decodeFromInputStream(bin); }  short getTag(); void setTag(short tag); Object getObj(); void setObj(Object obj); void encodeToOutputSteam(OutputStream bout); byte[] encodeToByteArray(); static TLV decodeFromByteArray(byte[] inputBytes); static TLV decodeFromInputStream(ByteArrayInputStream bin); static final short FLOAT64; static final short FLOAT32; static final short INT8; static final short INT16; static final short INT32; static final short INT64; static final short UINT8; static final short UINT16; static final short UINT32; static final short UINT64; static final short BYTES; static final short URI; static final short BOOL; }
@Test public void testDecodeFromByteArray() throws Exception { for(int i = 0; i < cases.size(); i++) { testPair pair = cases.get(i); TLV result = TLV.decodeFromByteArray(pair.bytes); assertEquals(pair.tlv.getTag(), result.getTag()); } }