- // Not included as default in above switch to ensure we get warnings when new versions are added
- throw new IOException("Encountered unhandled version" + version);
+ // Boron and Sodium snapshots use Java Serialization, but differ in stream format
+ private static @NonNull ShardDataTreeSnapshot readSnapshot(final ObjectInput in) throws IOException {
+ try {
+ return (ShardDataTreeSnapshot) in.readObject();
+ } catch (ClassNotFoundException e) {
+ LOG.error("Failed to serialize data tree snapshot", e);
+ throw new IOException("Snapshot failed to deserialize", e);
+ }