jwtk/jjwt

Replace String/byte[] with (N)IO streams

lhazlewood opened this issue · 0 comments

The Serializer/Deserializer concepts work with raw byte arrays, and coupled with Strings converted to byte arrays for their usage, heap allocation for both Strings and byte arrays (plus concatenation of both) can lead to to less-than-optimal heap usage. Reader/Writer concepts can be more efficient to work with directly.

For JWT building/compaction, this isn't likely to have much (if any?) benefit because a JWT's header and payload bytes must be available in their entirety for signature computation. But a Reader concept could help with parsing efficiency, especially with the DefaultJwtParser.isLikelyJson implementation, where a Reader could support lookahead/rewind fairly easily instead of working with raw byte arrays as it does today.

This issue represents any work (git branches, etc) associated with flushing this idea out.