zoukankan      html  css  js  c++  java
  • BitConverter.GetBytes(int)和BitConverter.ToString 方法 (Byte[])

    BitConverter.ToString 方法 (Byte[])

    网址:https://msdn.microsoft.com/zh-cn/library/3a733s97(v=vs.110).aspx

    BitConverter.GetBytes(int)

    网址:http://www.cnblogs.com/skyivben/archive/2011/01/14/1935594.html

    一、

    byte[ ] arrayOne = {
                 0,   1,   2,   4,   8,  16,  32,  64, 128, 255 };
    Console.WriteLine( BitConverter.ToString(arrayOne) );
    输出:00-01-02-04-08-10-20-40-80-FF

    二、
    long n = 0x1234567890ABCDEF;
    Console.WriteLine(n.ToString("X") + ": " + BitConverter.ToString(BitConverter.GetBytes(n)));
    输出:1234567890ABCDEF: EF-CD-AB-90-78-56-34-12

    转换为的数组是:int的低位开始
  • 相关阅读:
    去重
    JavaScript 数组
    变量
    2017.3.19 for
    2017.3.19 if,for
    2017.3.14
    2017.3.10
    2017.3.9
    2017.3.7-1
    2017.3.7
  • 原文地址:https://www.cnblogs.com/xuxueqin/p/7099185.html
Copyright © 2011-2022 走看看