Skip to content
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

修复EncodeToStream无法正常编码 #3

Merged
merged 1 commit into from
Sep 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public static long EncodeToStream(ReadOnlySpan<byte> data, Stream output, Span<b
do {
var readCount = Math.Min(Buffer0Length, remainingCount); // 读取数据长度
remainingCount -= readCount;
encodedCount += readCount;
var encodedLength = Encode(data.Slice(encodedCount, readCount), encodingBuffer); // 编码结果写入缓冲区
encodedCount += readCount;
output.Write(encodingBuffer[..encodedLength]); // 将缓冲区中指定长度的数据写入输出流
writeCount += encodedLength;
} while (remainingCount > 0);
Expand Down