Commit d4f98cc
committed
Refactor chunked stream reading logic for accuracy
Refactored the chunking logic in ChunkedStream to use nested loops, ensuring each yielded chunk is exactly _chunkSize unless at EOF. Improved resource management by returning buffers in a finally block and removed redundant code.1 parent 04afdf5 commit d4f98cc
1 file changed
Lines changed: 33 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | | - | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
58 | 88 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 89 | + | |
63 | 90 | | |
64 | | - | |
65 | 91 | | |
66 | 92 | | |
67 | 93 | | |
| |||
0 commit comments