对于下面的代码,我注意到~1秒的差异(序列化前的长时间= 1298298092890;反序列化后的长时间= 1298298093432)
public void readExternal(PofReader pReader) throws IOException {
//...0 to 8 omitted for brevity
tradeTimestamp =pReader.readDate(9);
entryTimestamp = pReader.readDate(10);
}
public void writeExternal(PofWriter pWriter) throws IOException {
//...0 to 8 omitted for brevity
pWriter.writeDate(9,tradeTimestamp);
pWriter.writeDate(10,entryTimestamp);
}
答案 0 :(得分:2)
根据API,writeDate的精度有限。请改用writeDateTime