Пример #1
0
        /// <summary>
        /// 从Position偏移位置读取8个字节
        /// 返回其UInt64表示类型
        /// </summary>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        /// <returns></returns>
        public ulong ReadUInt64()
        {
            var value = ByteConverter.ToUInt64(this._buffer, this.Position, this.Endian);

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

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