- snapshotState = new ShardSnapshotState(ShardDataTreeSnapshot.deserialize(toInputStream(in)));
- }
-
- private static InputStream toInputStream(final ObjectInput in) {
- if (in instanceof InputStream) {
- return (InputStream) in;
- }
-
- return new InputStream() {
- @Override
- public int read() throws IOException {
- return in.read();
- }
- };