zoukankan      html  css  js  c++  java
  • 字节序

    $.字节序是指多字节数据在计算机内存中存储或者网络传输时各字节的存储顺序。

    $.一个多字节数据按照其存储地址从低到高排列,如果最低有效字节在最高有效字节的前面,则称小端序;反之则称大端序。

    $.因为字符串是一个字节一个字节编码的,所以不存在大小端问题。

    $.注1
    public static byte[] BitConverter.GetBytes(int value);

    The order of bytes in the array returned by the GetBytes method depends on whether the computer
    architecture is little-endian or big-endian.

    $.注2
    public static readonly bool BitConverter.IsLittleEndian;

    This value is true if the architecture is little-endian; false if it is big-endian.

    $.注3
    public virtual int BinaryReader.ReadInt32();
    public virutal int BinaryWriter.WriteInt32();

    BinaryReader使用小端序读取数据;类似的,BinaryWriter也使用小端序写入数据。

    $.参考
    http://www.cnblogs.com/jeffreyzhao/archive/2010/02/10/byte-order-and-related-library.html

  • 相关阅读:
    悬线法练习
    Codechef MAY 15 Counting on a directed graph
    Codechef MAY 15 Chef and Balanced Strings
    兔子与兔子
    雪花雪花雪花
    约数之和
    分形之城
    递归实现组合型、指数型、排列型 枚举
    最短Hamilton路径
    六十四位整数乘法
  • 原文地址:https://www.cnblogs.com/codingthings/p/4326604.html
Copyright © 2011-2022 走看看