We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11b12e6 commit ee2df59Copy full SHA for ee2df59
Sources/StreamReader/Implementations/GenericStreamReader.swift
@@ -384,9 +384,12 @@ public final class GenericStreamReader : StreamReader {
384
let sizeRead = try sourceStream.read(bufferStart + bufferValidLength, maxLength: sizeToRead)
385
bufferValidLength += sizeRead
386
currentStreamReadPosition += sizeRead
387
- if sizeRead == 0 {streamHasReachedEOF = true}
388
assert(readSizeLimit == nil || currentStreamReadPosition <= readSizeLimit!)
389
+ if sizeRead == 0 || currentStreamReadPosition == readSizeLimit {
390
+ streamHasReachedEOF = true
391
+ }
392
+
393
if readContraints == .readFromStreamMaxOnce {break}
394
guard sizeRead > 0 else {
395
if readContraints.allowReadingLess {break}
0 commit comments