System.IO.BinaryWriter.Write Method

Writes a two-byte signed integer to the current stream and advances the stream position by two bytes.

Syntax

public virtual void Write (short value)

Parameters

value
The two-byte signed integer to write.

Remarks

BinaryWriter stores this data type in little endian format.

The following table lists examples of other typical or related I/O tasks.

Create a text file.

[<topic://cpconwritingtexttofile>]

Write to a text file.

[<topic://cpconwritingtexttofile>]

Read from a text file.

[<topic://cpconreadingtextfromfile>]

Append text to a file.

[<topic://cpconopeningappendingtologfile>]

File.AppendText(string)

FileInfo.AppendText

Get the size of a file.

FileInfo.Length

Get the attributes of a file.

File.GetAttributes(string)

Set the attributes of a file.

File.SetAttributes(string, FileAttributes)

Determine if a file exists.

File.Exists(string)

Read from a binary file.

[<topic://cpconReadingWritingToNewlyCreatedDataFile>]

Write to a binary file.

[<topic://cpconReadingWritingToNewlyCreatedDataFile>]

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0