'How get a data from cborMap?
I decode byte array with cbor and I want get a data but if I use cborMap.get("String"), not found a value.
byte[] bytecompressed = Base45.getDecoder().decode(withoutPrefix);
Inflater inflater = new Inflater();
inflater.setInput(bytecompressed);
int BUFFER_SIZE = bytecompressed.length;
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(BUFFER_SIZE);
byte[] buffer = new byte[BUFFER_SIZE];
while (!inflater.finished()) {
final int count;
try {
count = inflater.inflate(buffer);
outputStream.write(buffer, 0, count);
} catch (DataFormatException e) {
e.printStackTrace();
}
}
Message a = null;
try {
a = Encrypt0Message.DecodeFromBytes(outputStream.toByteArray());
CborMap cborMap = CborMap.createFromCborByteArray(a.GetContent());
System.out.println("CBORMAP " + cborMap);
cborMap.get("dn"); //NOT FOUND
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
