File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
MLAPI/NetworkingManagerComponents/Binary Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
namespace MLAPI . Serialization
2
2
{
3
+ /// <summary>
4
+ /// Binary helper class
5
+ /// </summary>
3
6
public static class BinaryHelpers
4
7
{
5
- // Swap endianness of a given integer
8
+ /// <summary>
9
+ /// Swaps the endianness of a given integer
10
+ /// </summary>
11
+ /// <returns>The integer with swapped endianness</returns>
12
+ /// <param name="value">The integer to swap endianess</param>
6
13
public static uint SwapEndian ( uint value ) => ( uint ) ( ( ( value >> 24 ) & ( 255 << 0 ) ) | ( ( value >> 8 ) & ( 255 << 8 ) ) | ( ( value << 8 ) & ( 255 << 16 ) ) | ( ( value << 24 ) & ( 255 << 24 ) ) ) ;
14
+ /// <summary>
15
+ /// Swaps the endianness of a given integer
16
+ /// </summary>
17
+ /// <returns>The integer with swapped endianness</returns>
18
+ /// <param name="value">The integer to swap endianess</param>
7
19
public static ulong SwapEndian ( ulong value ) =>
8
20
( ( value >> 56 ) & 0xFF ) |
9
21
( ( value >> 40 ) & ( 0xFFUL << 8 ) ) |
You can’t perform that action at this time.
0 commit comments