/// <summary> /// 把无符号整形转换成字节的数组 /// </summary> /// <param name="t"></param> /// <returns>返回值为一个长度为4的字节数组</returns> public static byte[] UintToBytes(uint t) { byte[] bytes = SEBinaryConverter.UintToBytes(t); return(bytes.Reverse().ToArray()); }
/// <summary> /// 把短整形转换成字节数组 /// </summary> /// <param name="t"></param> /// <returns>返回值是一个长度为2的字节数组</returns> public static byte[] ShortToBytes(short t) { byte[] bytes = SEBinaryConverter.ShortToBytes(t); return(bytes.Reverse().ToArray()); }
/// <summary> /// 把长整形转换成字节数组 /// </summary> /// <param name="t"></param> /// <returns>返回值为一个长度为8的字节数组</returns> public static byte[] LongToBytes(long t) { byte[] bytes = SEBinaryConverter.LongToBytes(t); return(bytes.Reverse().ToArray()); }