public Read ( byte buffer, int index, int count ) : int | ||
buffer | byte | The buffer to read into. |
index | int | Starting position inside the buffer. |
count | int | Number of bytes to read. |
return | int |
public override int Read(byte[] buffer, int index, int count)
{
uint bytesRead;
byte[] b = buffer;
if (index != 0)
{
b = new byte[buffer.Length - index];
buffer.CopyTo(b, 0);
}
comStream.Read(b, (uint)count, out bytesRead);
if (index != 0)
{
b.CopyTo(buffer, index);
}
return (int)bytesRead;
}