Skip to content

Add streaming I/O methods to JsonCodec SPI#6246

Open
tsegismont wants to merge 3 commits into
eclipse-vertx:masterfrom
tsegismont:json-improvements
Open

Add streaming I/O methods to JsonCodec SPI#6246
tsegismont wants to merge 3 commits into
eclipse-vertx:masterfrom
tsegismont:json-improvements

Conversation

@tsegismont

@tsegismont tsegismont commented Jul 15, 2026

Copy link
Copy Markdown
Member

Allow JSON decoding/encoding directly from/to streams and character sources, so that SQL clients can avoid intermediate String or byte[] allocations.

  • fromInputStream / toOutputStream for UTF-8 wire encodings (PG, MySQL)
  • fromReader / toWriter for non-UTF-8 wire encodings (e.g. MSSQL with UTF-16LE)

Some portions of this content were created with the assistance of Claude Opus 4.6

Allow JSON decoding from an InputStream and encoding to an OutputStream, so that SQL clients can pass ByteBufInputStream/ByteBufOutputStream directly and avoid intermediate String allocations.

Assisted-by: Claude Opus 4.6
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont
tsegismont requested a review from vietj July 15, 2026 15:40
@tsegismont

Copy link
Copy Markdown
Member Author

@vietj can you please take a look? It's still a draft because I haven't started the SQL Client updates yet.

Allow JSON decoding from a Reader and encoding to a Writer, so that SQL clients using non-UTF-8 wire encodings (e.g. MSSQL with UTF-16LE) can avoid intermediate String allocations.

Assisted-by: Claude Opus 4.6
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
Extract shared test implementations behind a boolean parameter (useReader/useWriter) so InputStream/OutputStream and Reader/Writer tests share the same assertion logic.

Assisted-by: Claude Opus 4.6
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont tsegismont changed the title Add InputStream/OutputStream methods to JsonCodec SPI Add streaming I/O methods to JsonCodec SPI Jul 16, 2026
@tsegismont tsegismont added this to the 5.2.0 milestone Jul 16, 2026
@tsegismont
tsegismont marked this pull request as ready for review July 16, 2026 15:50
@tsegismont

tsegismont commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

This is ready for review. You can see how the new methods are used in tsegismont/vertx-sql-client@8d716e3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant