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

  • 相关阅读:
    java反射小练习
    Set与list测试
    关于用户界面
    自定义标签打包使用问题
    jsp中获取当前访问路径
    LeetCode 汇总
    LeetCode 46. 全排列
    LeetCode 40.组合总和II
    LeetCode 39.组合总和
    LeetCode 37.解数独
  • 原文地址:https://www.cnblogs.com/codingthings/p/4326604.html
Copyright © 2011-2022 走看看