Skip to content

Commit 01b6c7c

Browse files
committed
fix CustomStreamWriter
1 parent dc4d347 commit 01b6c7c

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

UnityAsset.NET/IO/Writer/CustomStreamWriter.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,12 @@ public ulong WriteBytes(IReader reader)
101101
while (reader.Remaining > 0)
102102
{
103103
var bytesRead = reader.Read(_buffer, _bufferPos, BuffRemaining);
104-
if (bytesRead == BuffRemaining)
104+
_bufferPos += bytesRead;
105+
106+
if (BuffRemaining == 0)
105107
{
106108
FlushBuffer();
107109
}
108-
else
109-
{
110-
_bufferPos += bytesRead;
111-
}
112110

113111
totalBytesRead += (uint)bytesRead;
114112
}

0 commit comments

Comments
 (0)