System.IO.BinaryWriter.Write C# (CSharp) Method

Write() public method

public Write ( bool value ) : void
value bool
return void
        public virtual void Write(bool value)
        {
            _buffer[0] = (byte)(value ? 1 : 0);
            OutStream.Write(_buffer, 0, 1);
        }

Same methods

BinaryWriter::Write ( byte value ) : void
BinaryWriter::Write ( byte buffer, int index, int count ) : void
BinaryWriter::Write ( char ch ) : void
BinaryWriter::Write ( char chars, int index, int count ) : void
BinaryWriter::Write ( decimal value ) : void
BinaryWriter::Write ( double value ) : void
BinaryWriter::Write ( float value ) : void
BinaryWriter::Write ( int value ) : void
BinaryWriter::Write ( long value ) : void
BinaryWriter::Write ( sbyte value ) : void
BinaryWriter::Write ( short value ) : void
BinaryWriter::Write ( string value ) : void
BinaryWriter::Write ( uint value ) : void
BinaryWriter::Write ( ulong value ) : void
BinaryWriter::Write ( ushort value ) : void

Usage Example

 // DSFチャンクの数字はリトルエンディアンバイトオーダー
 private void BwWriteLE4(BinaryWriter bw, uint v)
 {
     bw.Write((byte)(v & 0xff));
     bw.Write((byte)((v >> 8) & 0xff));
     bw.Write((byte)((v >> 16) & 0xff));
     bw.Write((byte)((v >> 24) & 0xff));
 }
All Usage Examples Of System.IO.BinaryWriter::Write