SwapUInt32() public static method

public static SwapUInt32 ( uint v ) : uint
v uint
return uint
示例#1
0
        /// <summary>
        /// Reads a uint from the underlying stream.
        /// </summary>
        /// <returns>A uint.</returns>
        public uint ReadUInt32()
        {
            lock (m_Reader)
            {
                if (Endian.IsBigEndian != m_IsBigEndian)
                {
                    return(Endian.SwapUInt32(m_Reader.ReadUInt32()));
                }

                return(m_Reader.ReadUInt32());
            }
        }
示例#2
0
        /// <summary>
        /// Writes a uint to the underlying stream.
        /// </summary>
        /// <param name="Val">The uint to write.</param>
        public void WriteUInt32(uint Val)
        {
            lock (m_Writer)
            {
                if (Endian.IsBigEndian != m_IsBigEndian)
                {
                    Endian.SwapUInt32(Val);
                    m_Writer.Write(Val);

                    return;
                }

                m_Writer.Write(Val);
            }
        }