Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SerialPort.BytesToRead Property


Gets the number of bytes of data in the receive buffer.

Namespace:   System.IO.Ports
Assembly:  System (in System.dll)

public int BytesToRead { get; }

Property Value

Type: System.Int32

The number of bytes of data in the receive buffer.

Exception Condition

The port is not open.

The receive buffer includes the serial driver's receive buffer as well as internal buffering in the SerialPort object itself.

Because the BytesToRead property represents both the SerialPort buffer and the Windows-created buffer, it can return a greater value than the ReadBufferSize property, which represents only the Windows-created buffer.

.NET Framework
Available since 2.0
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft