don't assume that the number of bytes actually read/written are equal to what we asked for
This commit is contained in:
parent
b983f526f4
commit
40e016c8d1
@ -92,15 +92,18 @@ namespace UniversalEditor.Accessors
|
||||
{
|
||||
// TODO: will ct ever be != count? should we add ct to Position instead of count??
|
||||
int ct = mvarBaseStream.Read(buffer, start, count);
|
||||
// Position += count;
|
||||
return count;
|
||||
|
||||
// --->: apparently, ct sometimes DOES != count, and it's important here to return ct
|
||||
// instead of count to prevent freezing on certain streams
|
||||
return ct;
|
||||
}
|
||||
|
||||
protected internal override int WriteInternal(byte[] buffer, int start, int count)
|
||||
{
|
||||
long oldpos = Position;
|
||||
mvarBaseStream.Write(buffer, start, count);
|
||||
// Position += count;
|
||||
return count;
|
||||
return (int)(Position - oldpos);
|
||||
}
|
||||
|
||||
protected override void OpenInternal()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user