- public static void serializePathAndNode(YangInstanceIdentifier path, NormalizedNode<?, ?> node,
- DataOutput out) {
- Preconditions.checkNotNull(path);
- Preconditions.checkNotNull(node);
- try {
- NormalizedNodeDataOutput streamWriter = streamWriter(out);
- streamWriter.writeNormalizedNode(node);
- streamWriter.writeYangInstanceIdentifier(path);
- } catch (IOException e) {
- throw new IllegalArgumentException(String.format("Error serializing path %s and Node %s",
- path, node), e);
- }
+ public static YangInstanceIdentifier readPath(final DataInput in) throws IOException {
+ return NormalizedNodeDataInput.newDataInput(in).readYangInstanceIdentifier();