- public static NormalizedNodeDataInput newDataInput(@Nonnull final DataInput input) throws IOException {
- final byte marker = input.readByte();
- if (marker != TokenTypes.SIGNATURE_MARKER) {
- throw new InvalidNormalizedNodeStreamException(String.format("Invalid signature marker: %d", marker));
- }
-
- final short version = input.readShort();
- switch (version) {
- case TokenTypes.LITHIUM_VERSION:
- return new NormalizedNodeInputStreamReader(input, true);
- default:
- throw new InvalidNormalizedNodeStreamException(String.format("Unhandled stream version %s", version));
- }
+ public static NormalizedNodeDataInput newDataInput(final @NonNull DataInput input) throws IOException {
+ return new VersionedNormalizedNodeDataInput(input).delegate();