sys\system\io\ports\SerialPort.cs (18)
183return internalSerialStream.BytesToRead + CachedBytesToRead; // count the number of bytes we have in the internal buffer too.
868if (CachedBytesToRead >= 1)
870bytesReadToBuffer = Math.Min(CachedBytesToRead, count);
883Debug.Assert(CachedBytesToRead == 0, "there should be nothing left in our internal buffer");
918if (decoder.GetCharCount(inBuffer, readPos, CachedBytesToRead) != 0)
1023int charsWeAlreadyHave = decoder.GetCharCount(inBuffer, readPos, CachedBytesToRead); // full chars already in our buffer
1079int bytesToRead = Math.Min(count, CachedBytesToRead);
1157} while ((totalCharsFound < count) && (totalBytesExamined < CachedBytesToRead));
1186Buffer.BlockCopy(inBuffer, readPos, bytesReceived, 0, CachedBytesToRead);
1188internalSerialStream.Read(bytesReceived, CachedBytesToRead, bytesReceived.Length - (CachedBytesToRead)); // get everything
1311int bytesToSave = CachedBytesToRead;
1453Buffer.BlockCopy(inBuffer, readPos, inBuffer, 0, CachedBytesToRead);
1454readLen = CachedBytesToRead;
1472if (CachedBytesToRead + additionalByteLength <= inBuffer.Length / 2)
1476int newLength = Math.Max(CachedBytesToRead + additionalByteLength, inBuffer.Length * 2);
1481Buffer.BlockCopy(inBuffer, readPos, newBuffer, 0, CachedBytesToRead);
1482readLen = CachedBytesToRead;