NDesk.DBus.MessageWriter.MarshalUShort C# (CSharp) Method

MarshalUShort() protected method

protected MarshalUShort ( byte data ) : void
data byte
return void
        protected unsafe void MarshalUShort(byte *data)
        {
            WritePad (2);
            byte[] dst = new byte[2];

            if (endianness == Connection.NativeEndianness) {
                dst[0] = data[0];
                dst[1] = data[1];
            } else {
                dst[0] = data[1];
                dst[1] = data[0];
            }

            stream.Write (dst, 0, 2);
        }