Skip to content

CSV encode to ByteBuffer? #100

Closed Answered by osiegmar
javafanboy asked this question in Q&A
Discussion options

You must be logged in to vote

I can see that fast CSV integrates with StringWriter

A StringWriter is usually used for demonstration purposes only. The usual use pattern (write to a CSV file) is based on an OutputStreamWriter (see CsvWriter.CsvWriterBuilder#build(java.nio.file.Path, java.nio.file.OpenOption...)).

Any thoughts on if this is possible and in that case how?

You may simply try it by changing the implementation of CsvWriter.FastBufferedWriter to use a ByteBuffer/CharBuffer instead of a char[] buf and a WritableByteChannel instead of a Writer.

Then do extensive JMH benchmarks.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by osiegmar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants