mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
19 lines
415 B
C#
19 lines
415 B
C#
|
using System;
|
|||
|
|
|||
|
namespace Plugins.JNGame.Util
|
|||
|
{
|
|||
|
public class ToUtil
|
|||
|
{
|
|||
|
public static int Byte4ToInt(byte[] data)
|
|||
|
{
|
|||
|
return BitConverter.ToInt32(data, 0);
|
|||
|
}
|
|||
|
|
|||
|
public static byte[] IntToByte4(int value)
|
|||
|
{
|
|||
|
byte[] result = new byte[4];
|
|||
|
BitConverter.GetBytes(value).CopyTo(result, 0);
|
|||
|
return result;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|