我从服务器获取数据 - 是一个CBOR编码的字节[]数组,并解码此我使用cbor-java实现。Java - 如何解码CBOR编码的byte []数组?
byte[] decodedMessage = { 0x78, (byte)0x9c, 0x5b, (byte)0xe4, 0x58, 0x10}
ByteArrayInputStream bais = new ByteArrayInputStream(decodedMessage);
List<DataItem> dataItems = new CborDecoder(bais).decode();
for(DataItem dataItem : dataItems) {
}
如果你有这样的一些经验,你能解释一下我怎样可以得到阵列的解码的内容,而不是DataItem对象。
到目前为止您尝试了什么? –
@AbhijitSarkar我用答案波纹管,并适应我的情况 –