Respond with minimum amount of bytes necessary to fix elusive bug

This commit is contained in:
Michael Becker 2015-10-12 22:53:00 -04:00
parent 4fde30ce32
commit ad230fce3d

View File

@ -101,6 +101,7 @@ namespace UniversalEditor.Accessors
protected internal override int ReadInternal(byte[] buffer, int start, int count)
{
byte[] bytes = this.DefaultEncoding.GetBytes(_data, (int)ptr, 1);
count = System.Math.Min(bytes.Length, count);
System.Array.Copy(bytes, 0, buffer, start, count);
ptr += count;
return count;