Exemplo n.º 1
0
        /// <summary>
        /// 从Position偏移位置读取8个字节
        /// 返回其Int64表示类型
        /// </summary>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        /// <returns></returns>
        public long ReadInt64()
        {
            var value = ByteConverter.ToInt64(this._buffer, this.Position, this.Endian);

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

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