예제 #1
0
        /// <summary>
        ///
        /// </summary>
        public int ToInt(EndianMode mode = EndianMode.Big)
        {
            var sum = 0;

            for (var i = 0; i < 8; i++)
            {
                sum += _bits[i].Value ? (int)Math.Pow(2, mode == EndianMode.Big ? (8 - (i + 1)) : i) : 0;
            }
            return(sum);
        }
예제 #2
0
 public void SetEndianness(EndianMode endianMode) {
     CheckNull();
     CheckDefine();
     NcCheck.Check(NetCDF.nc_def_var_endian(groupId, myId, (int)endianMode));
 }
예제 #3
0
 public NBTReader(FileStream f, Encoding e, EndianMode mode = EndianMode.Big)
     : base(f, e)
 {
     EndianMode = mode;
 }