C# 截取 byte 字节 转字符串

  byte[] byteArray = System.Text.Encoding.Default.GetBytes(content);

Byte[] ThisByte = new Byte[1];
Buffer.BlockCopy(byteArray, 30, ThisByte, 0, 1);
string str=Encoding.Default.GetString(ThisByte);

 //
        // 摘要:
        //     将指定数目的字节从起始于特定偏移量的源数组复制到起始于特定偏移量的目标数组。
        //
        // 参数:
        //   src:
        //     源缓冲区。
        //
        //   srcOffset:
        //     src 中从零开始的字节偏移量。
        //
        //   dst:
        //     目标缓冲区。
        //
        //   dstOffset:
        //     dst 中从零开始的字节偏移量。
        //
        //   count:
        //     要复制的字节数。
        //
        // 异常:
        //   T:System.ArgumentNullException:
        //     src 或 dst 为 null。
        //
        //   T:System.ArgumentException:
        //     src 或 dst 不是基元数组。- 或 -src 的长度小于 srcOffset 加上 count。- 或 -dst 的长度小于 dstOffset 加上
        //     count。
        //
        //   T:System.ArgumentOutOfRangeException:
        //     srcOffset、dstOffset 或 count 小于 0。
        [SecuritySafeCritical]
        public static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count);

原文地址:https://www.cnblogs.com/LuoEast/p/10105888.html