SerialPort.ReadBufferSize Property


Gets or sets the size of the SerialPort input buffer.

 property int ReadBufferSize { int get(); void set(int value); };
public int ReadBufferSize { get; set; }
member this.ReadBufferSize : int with get, set
Public Property ReadBufferSize As Integer

Property Value

The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647.



The ReadBufferSize value set is less than or equal to zero.

The ReadBufferSize property was set while the stream was open.

The ReadBufferSize property was set to an odd integer value.


The ReadBufferSize property ignores any value smaller than 4096.

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

Applies to