This documentation is archived and is not being maintained.

SerialPort.ReadBufferSize Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets the size of the SerialPort input buffer.

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

public int ReadBufferSize { get; set; }
/** @property */
public int get_ReadBufferSize ()

/** @property */
public void set_ReadBufferSize (int value)

public function get ReadBufferSize () : int

public function set ReadBufferSize (value : int)

Property Value

The buffer size. The default value is 4096.

Exception typeCondition


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.


The BytesToRead property can return a value larger than the ReadBufferSize property because the ReadBufferSize property represents only the Windows-created buffer while the BytesToRead property represents the SerialPort buffer in addition to the Windows-created buffer.

Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows CE Platform Note: On Windows CE, the buffer sizes passed are only recommendations, not requirements of the serial driver. The serial driver may ignore the recommended buffer sizes.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

.NET Compact Framework

Supported in: 2.0