private Data deserializeMapDB(DataInput in) throws IOException {
ByteBuf buf = Unpooled.buffer();
Data data = null;
while(data == null) {
buf.writeByte(in.readByte());
data = Data.decodeHeader(buf, signatureFactory);
}
int len = data.length();
byte me[] = new byte[len];
in.readFully(me);
buf = Unpooled.wrappedBuffer(me);
boolean retVal = data.decodeBuffer(buf);
if(!retVal) {
throw new IOException("data could not be read");
}
retVal = data.decodeDone(buf, signatureFactory);
if(!retVal) {
throw new IOException("signature could not be read");
}
return data;
}
This function always throws IOException("signature could not be read")
I think this line goes wrong : retVal = data.decodeDone(buf, signatureFactory);
Because "buf" is still the buffer for "data.decodeBuffer"!!! Maybe you should read the buffer before "data.decodeDone"?
: )
net/tomp2p/storage/DataSerializer.java
This function always throws IOException("signature could not be read") I think this line goes wrong : retVal = data.decodeDone(buf, signatureFactory); Because "buf" is still the buffer for "data.decodeBuffer"!!! Maybe you should read the buffer before "data.decodeDone"? : )