Amir Hossein Sharifzadeh
03/14/2023, 1:55 AMDataFileChunk class, I will have to change the types for chunk_hash and data from String to BinaryValue . In my deserialize method, I should hash byte array of data and the compare it with the byte array of chunk_hash :
dataFileChunk.data = list.get(8).asBinaryValue();
output.write(dataFileChunk.data.asByteArray());
dataFileChunk.dataByteArray = dataFileChunk.data.asByteArray();
assert md != null;
md.update(dataFileChunk.data.asByteArray());
byte[] bts = md.digest();
String s1 = Base64.getEncoder().encodeToString(bts);
String s2 = Base64.getEncoder().encodeToString(dataFileChunk.chunk_hash.asByteArray());