I figured the issue: In `DataFileChunk` class, I w...
# troubleshooting
a
I figured the issue: In
DataFileChunk
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
:
Copy code
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());