/// <summary>
        /// 从Position偏移位置读取4个字节
        /// 返回其UInt32表示类型
        /// </summary>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        /// <returns></returns>
        public uint ReadUInt32()
        {
            var value = ByteConverter.ToUInt32(this._buffer, this.Position, this.Endian);

            this.Position = this.Position + sizeof(uint);
            return(value);
        }
Exemple #2
0
 /// <summary>
 /// 读取指定位置4个字节,返回其UInt32表示类型
 /// </summary>
 /// <param name="index">字节所在索引</param>
 /// <param name="littleEndian">是否低位在前</param>
 /// <returns></returns>
 public uint ToUInt32(int index, bool littleEndian)
 {
     return(ByteConverter.ToUInt32(this.Source, index, littleEndian));
 }
Exemple #3
0
        /// <summary>
        /// 从流中读取4个字节,并将流内的位置向前推进4个字节,
        /// 返回其UInt32表示类型
        /// </summary>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        /// <returns></returns>
        public uint ReadUInt32()
        {
            var range = this.ReadByteRange(sizeof(uint));

            return(ByteConverter.ToUInt32(range.Buffer, range.Offset, this.Endian));
        }
Exemple #4
0
 /// <summary>
 /// 读取指定位置4个字节,返回其UInt32表示类型
 /// </summary>
 /// <param name="index">字节所在索引</param>
 /// <param name="endian">高低位</param>
 /// <returns></returns>
 public uint ToUInt32(int index, Endians endian)
 {
     return(ByteConverter.ToUInt32(this.Source, index, endian));
 }