メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。
指定したバイト数を指定したオフセットで出力バッファに書き込みます。
名前空間: System.IO.Ports
アセンブリ: System (system.dll 内)
Public Sub Write ( _
buffer As Byte(), _
offset As Integer, _
count As Integer _
)
Dim instance As SerialPort
Dim buffer As Byte()
Dim offset As Integer
Dim count As Integer
instance.Write(buffer, offset, count)
public void Write (
byte[] buffer,
int offset,
int count
)
public:
void Write (
array<unsigned char>^ buffer,
int offset,
int count
)
public void Write (
byte[] buffer,
int offset,
int count
)
public function Write (
buffer : byte[],
offset : int,
count : int
)
パラメータ
- buffer
出力の書き込み先となるバイト配列。
- offset
書き込みを開始するバッファ配列内のオフセット。
- count
書き込むバイト数。
シリアル ポートへの出力を作成するために、バイト バッファに書き込む場合は、このメソッドを使用します。
入力バッファに大量のデータが格納されているとき、Handshake が XOnXOff に設定されている場合、これ以上のデータをデバイスが受け取ることができるまで待機している間に、SerialPort オブジェクトによって TimeoutException が発生することがあります。
既定では、SerialPort は ASCIIEncoding を使用して文字をエンコードします。ASCIIEncoding は、127 文字を超えるすべての文字を (char)63 または '?' としてエンコードします。その範囲内の追加の文字をサポートするには、Encoding に UTF8Encoding、UTF32Encoding、または UnicodeEncoding を設定します。
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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
.NET Framework
サポート対象 : 2.0
.NET Compact Framework
サポート対象 : 2.0