Export (0) Print
Expand All

SerialPort.ReadBufferSize Property

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)

Not applicable.

Property Value

The buffer size. The default value is 4096.

Exception typeCondition

ArgumentOutOfRangeException

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

InvalidOperationException

The ReadBufferSize property was set while the stream was open.

IOException

The ReadBufferSize property was set to an odd integer value.

The ReadBufferSize property ignores any value smaller than 4096.

NoteNote:

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 2003 for Pocket PC, Windows Mobile 2003 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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

.NET Compact Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft