odnoklassniki/one-nio

java.time bug

MacX19 opened this issue · 2 comments

    byte[] res;
    try (PersistStream stream = new PersistStream()) {
      Instant now = Instant.now();
      stream.writeObject(now);
      stream.writeObject(now);
      res = stream.toByteArray();
    }
    try (DeserializeStream des = new DeserializeStream(res)) {
      System.out.println(des.readObject());
      System.out.println(des.readObject());
    }

Output:

2022-07-13T06:21:56.517Z
null

Adding in.register(result); to JavaTimeSerializer.read should fix this

Fixed in one-nio 1.6.0