> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor/ks.reactor.ksfixeddataparser.md).

# Class ksFixedDataParser

Namespace: [KS.Reactor](/reactor/api-reference/ks.reactor.md)\
Assembly: KSCommon.dll

A class that parses byte array to uint or struct.

```csharp
public class ksFixedDataParser
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksFixedDataParser](/reactor/api-reference/ks.reactor/ks.reactor.ksfixeddataparser.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Methods

### ParseEncodedUInt(byte\[], ref int) <a href="#ks_reactor_ksfixeddataparser_parseencodeduint_system_byte___system_int32" id="ks_reactor_ksfixeddataparser_parseencodeduint_system_byte___system_int32"></a>

Read out an encoded uint from a byte array. The lowest bit positions of the encoded value signal the number of bytes to read. If the first bit is 0, then the value is in bits 1 to 7. If the first two bits are 01, then value is in bits 2 to 15. If the first two bits are 11, then value is in bits 2 to 31.

```csharp
public static uint ParseEncodedUInt(byte[] data, ref int offset)
```

#### Parameters

`data` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

Input byte array.

`offset` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Offset to begin reading from.

#### Returns

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

The uint read out.

### ParseFromBytes\<T>(byte\[], int) <a href="#ks_reactor_ksfixeddataparser_parsefrombytes__1_system_byte___system_int32" id="ks_reactor_ksfixeddataparser_parsefrombytes__1_system_byte___system_int32"></a>

Read a struct from a byte array

```csharp
public static T ParseFromBytes<T>(byte[] inputdata, int offset) where T : struct
```

#### Parameters

`inputdata` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

Input byte array.

`offset` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Offset to begin reading from.

#### Returns

T

Output struct

#### Type Parameters

`T`

Type of the struct to read out.

### ParseFromUInt\<T>(uint) <a href="#ks_reactor_ksfixeddataparser_parsefromuint__1_system_uint32" id="ks_reactor_ksfixeddataparser_parsefromuint__1_system_uint32"></a>

Convert the bytes of a uint into another struct.

```csharp
public static T ParseFromUInt<T>(uint inputData)
```

#### Parameters

`inputData` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Input uint data.

#### Returns

T

Output struct.

#### Type Parameters

`T`

Type of the struct to convert to.
