private Token nextToken() {
        try {
            JsonToken token = parser.nextValue();
            if (token == null)
                throw new IllegalStateException("no more JSON tokens");
            return new Token(token, parser.currentName(), parser.getText());
        }
        catch (IOException e) {
            throw new IllegalArgumentException("failed reading document JSON", e);
        }
    }
A {@link TokenBuffer} which only buffers tokens when needed, i.e., when peeking.

@author jonmv
document/src/main/java/com/yahoo/document/json/LazyTokenBuffer.java