-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix CharReaderFromSyncStream read characters less than chunkSize (#2108) #2109
Merged
soywiz
merged 6 commits into
korlibs:main
from
itboy87:fix/2108/CharReaderFromSyncStream
Jan 1, 2024
Merged
fix CharReaderFromSyncStream read characters less than chunkSize (#2108) #2109
soywiz
merged 6 commits into
korlibs:main
from
itboy87:fix/2108/CharReaderFromSyncStream
Jan 1, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
soywiz
reviewed
Jan 1, 2024
soywiz
reviewed
Jan 1, 2024
soywiz
requested changes
Jan 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URLText extra test should be done in a separate PR since it looks unrelated to this
@soywiz ok i will update it. |
soywiz
approved these changes
Jan 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was an issue with
CharReaderFromSyncStream
. When attempting to read characters fewer than the specifiedchunkSize
, it returns the maximumchunkSize
data instead. I have set a minimumchunkSize
limit to 8 because the decoder requires a minimum size of the maximum character size to decode. I believe the maximum character size in bytes is 4 bytes, but for safety, I used 8 bytes. Therefore, if anyone sets the chunkSize to less than 8, it will throw an exception.chunkSize
and throwIllegalArgumentException
exception if its less thanMIN_CHUNK_SIZE
bufferUp()
function. This function returns the number of bytes added to the buffer. IftempStringBuilder
doesn't have enough characters to read, the function will attempt to read more into the buffer until the condition is met or the stream is empty.This PR closes #2108