Two contributions to Argo, a dependency-free JSON library for Java Argo JSON Library

Background

Argo is a JSON parser and generator for Java without external dependencies, maintained by Mark Slater and originally hosted on SourceForge.

Contribution

Incomplete reads (2016). Reader.read(char[]) may return fewer characters than the buffer holds, in which case the caller is expected to call it again. Argo's PositionTrackingPushbackReader assumed a single call filled the buffer. With readers backed by local data this rarely shows, but with readers backed by a network buffer it caused parse failures. I changed the reader to keep reading until the buffer is full or the input ends, and added a regression test using a reader that deliberately returns input in small pieces. The maintainer merged the fix.

Buffered reading (2026). Pull request #19 changed JsonParser to read from its Reader into a small character buffer instead of one character at a time. This reduces per-character overhead and follows the usual Reader.read(char[]) pattern, without changing parsing behaviour.

Discussion

Both changes concern the same boundary: how a parser consumes its input. The first is a correctness issue that only appears with certain kinds of input source, which is why the regression test simulates one rather than relying on local data. Small libraries without dependencies are a recurring preference in my work, and Argo is one I have used for a long time.