Düzenle

Aracılığıyla paylaş


SerialPort.ReadBufferSize Property

Definition

Gets or sets the size of the SerialPort input buffer.

public:
 property int ReadBufferSize { int get(); void set(int value); };
public int ReadBufferSize { get; set; }
[System.ComponentModel.Browsable(true)]
public int ReadBufferSize { get; set; }
member this.ReadBufferSize : int with get, set
[<System.ComponentModel.Browsable(true)>]
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.

Attributes

Exceptions

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.

Remarks

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