Abduqodiri Qurbonzoda [JB]
08/13/2024, 3:41 PM'='
as the end of the symbol stream. As a result, subsequent symbols are not read, even if the end of the underlying input stream has not been reached.
Do you find it counterintuitive that the returned input stream ignores symbols after the padding character? This behavior is similar to Java Base64.Decoder.wrap(InputStream)Abduqodiri Qurbonzoda [JB]
08/13/2024, 3:47 PMAbduqodiri Qurbonzoda [JB]
08/13/2024, 6:16 PM```* The requirement, prohibition, or optionality of padding in the input symbols
* is determined by the [PaddingOption] set for the [base64] instance.```Please see the latest documentation on GitHub.
Abduqodiri Qurbonzoda [JB]
08/13/2024, 6:21 PMChris Lee
08/13/2024, 6:34 PMAn alternative would be to require that the underlying stream has indeed ended after the pad character is encountered.Not fond of this. consumers of a stream (Base64 decoder) shouldn’t be coupled to additional context as to what comes before/after in the stream - they read what they need to and stop, leaving the stream for others to use if need be. Perhaps the stream contains unrelated content to be read afterwards. The original behaviour is consistent with that. “decode base64 from this stream” vs “decode this stream of base64" (former is the desired behaviour, it doesn’t presume the stream is solely/dedicated to base64 content) What if one had a stream of multiple base64-encoded things?
CLOVIS
08/13/2024, 7:27 PMAs a result, subsequent symbols are not read, even if the end of the underlying input stream has not been reached.I like this behavior. Input streams are often used for low-level stuff. If I were parsing some data, I may want to parse a base64 string that's within a more complex data structure, so the function not touching the rest seems convenient to me.
Abduqodiri Qurbonzoda [JB]
08/14/2024, 9:16 AMCLOVIS
08/14/2024, 9:36 AM