+ default NormalizedNode<?, ?> readNormalizedNode() throws IOException {
+ return readNormalizedNode(ReusableImmutableNormalizedNodeStreamWriter.create());
+ }
+
+ /**
+ * Read a normalized node from the reader, using specified writer to construct the result.
+ *
+ * @param receiver Reusable receiver to, expected to be reset
+ * @return Next node from the stream, or null if end of stream has been reached.
+ * @throws IOException if an error occurs
+ * @throws IllegalStateException if the dictionary has been detached
+ */
+ default NormalizedNode<?, ?> readNormalizedNode(final ReusableStreamReceiver receiver) throws IOException {
+ try {
+ streamNormalizedNode(receiver);
+ return receiver.getResult();
+ } finally {
+ receiver.reset();
+ }
+ }