Npgsql.WriteBuffer.WriteInt32 C# (CSharp) Method

WriteInt32() public method

public WriteInt32 ( int i ) : void
i int
return void
        public void WriteInt32(int i)
        {
            Contract.Requires(WriteSpaceLeft >= sizeof(int));
            var pos = _writePosition;
            _buf[pos++] = (byte)(i >> 24);
            _buf[pos++] = (byte)(i >> 16);
            _buf[pos++] = (byte)(i >> 8);
            _buf[pos++] = (byte)i;
            _writePosition = pos;
        }

Usage Example

示例#1
0
 void WriteHeader()
 {
     EnsureDataMessage();
     _buf.WriteBytes(NpgsqlRawCopyStream.BinarySignature, 0, NpgsqlRawCopyStream.BinarySignature.Length);
     _buf.WriteInt32(0);   // Flags field. OID inclusion not supported at the moment.
     _buf.WriteInt32(0);   // Header extension area length
 }
All Usage Examples Of Npgsql.WriteBuffer::WriteInt32