> 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.ksinputbuffer.md).

# Class ksInputBuffer

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

This input buffer reads data written to a byte array by a ksOutputBuffer.

```csharp
[Obsolete("Use ksStreamBuffer instead.")]
public class ksInputBuffer
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksInputBuffer](/reactor/api-reference/ks.reactor/ks.reactor.ksinputbuffer.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)

## Constructors

### ksInputBuffer(byte\[]) <a href="#ks_reactor_ksinputbuffer__ctor_system_byte" id="ks_reactor_ksinputbuffer__ctor_system_byte"></a>

Construct an input buffer from a byte array.

```csharp
public ksInputBuffer(byte[] data)
```

#### Parameters

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

Data source.

## Properties

### EndOfData <a href="#ks_reactor_ksinputbuffer_endofdata" id="ks_reactor_ksinputbuffer_endofdata"></a>

Check if the internal position has reached the end of the buffer.

```csharp
public bool EndOfData { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

### Get\<T>() <a href="#ks_reactor_ksinputbuffer_get__1" id="ks_reactor_ksinputbuffer_get__1"></a>

Gets a struct of type T from the buffer.

```csharp
public T Get<T>() where T : struct
```

#### Returns

T

Struct value.

#### Type Parameters

`T`

### GetBool() <a href="#ks_reactor_ksinputbuffer_getbool" id="ks_reactor_ksinputbuffer_getbool"></a>

Gets a bool from the buffer.

```csharp
public bool GetBool()
```

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Bool value.

### GetBoolArray() <a href="#ks_reactor_ksinputbuffer_getboolarray" id="ks_reactor_ksinputbuffer_getboolarray"></a>

Get an array of bools from the buffer.

```csharp
public bool[] GetBoolArray()
```

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\[]

Bool array.

### GetBufferable\<T>() <a href="#ks_reactor_ksinputbuffer_getbufferable__1" id="ks_reactor_ksinputbuffer_getbufferable__1"></a>

Get a ksIBufferable object from the buffer.

```csharp
public T GetBufferable<T>() where T : ksIBufferable, new()
```

#### Returns

T

ksIBufferable object.

#### Type Parameters

`T`

### GetByte() <a href="#ks_reactor_ksinputbuffer_getbyte" id="ks_reactor_ksinputbuffer_getbyte"></a>

Gets a byte from the buffer.

```csharp
public byte GetByte()
```

#### Returns

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

Byte value.

### GetByteArray() <a href="#ks_reactor_ksinputbuffer_getbytearray" id="ks_reactor_ksinputbuffer_getbytearray"></a>

Get an array of bytes from the buffer.

```csharp
public byte[] GetByteArray()
```

#### Returns

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

Byte array.

### GetBytes(int) <a href="#ks_reactor_ksinputbuffer_getbytes_system_int32" id="ks_reactor_ksinputbuffer_getbytes_system_int32"></a>

Gets bytes from the buffer.

```csharp
public byte[] GetBytes(int length)
```

#### Parameters

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

Length of byte array to get.

#### Returns

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

Byte array.

### GetChar() <a href="#ks_reactor_ksinputbuffer_getchar" id="ks_reactor_ksinputbuffer_getchar"></a>

Gets a char from the buffer.

```csharp
public char GetChar()
```

#### Returns

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

Char value.

### GetCharArray() <a href="#ks_reactor_ksinputbuffer_getchararray" id="ks_reactor_ksinputbuffer_getchararray"></a>

Get an array of chars from the buffer.

```csharp
public char[] GetCharArray()
```

#### Returns

[char](https://learn.microsoft.com/dotnet/api/system.char)\[]

Char array.

### GetDouble() <a href="#ks_reactor_ksinputbuffer_getdouble" id="ks_reactor_ksinputbuffer_getdouble"></a>

Gets a double from the buffer.

```csharp
public double GetDouble()
```

#### Returns

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

Double value.

### GetDoubleArray() <a href="#ks_reactor_ksinputbuffer_getdoublearray" id="ks_reactor_ksinputbuffer_getdoublearray"></a>

Get an array of doubles from the buffer.

```csharp
public double[] GetDoubleArray()
```

#### Returns

[double](https://learn.microsoft.com/dotnet/api/system.double)\[]

Double array.

### GetFloat() <a href="#ks_reactor_ksinputbuffer_getfloat" id="ks_reactor_ksinputbuffer_getfloat"></a>

Gets a float from the buffer.

```csharp
public float GetFloat()
```

#### Returns

[float](https://learn.microsoft.com/dotnet/api/system.single)

Float value.

### GetFloatArray() <a href="#ks_reactor_ksinputbuffer_getfloatarray" id="ks_reactor_ksinputbuffer_getfloatarray"></a>

Get an array of floats from the buffer.

```csharp
public float[] GetFloatArray()
```

#### Returns

[float](https://learn.microsoft.com/dotnet/api/system.single)\[]

Float array.

### GetInt() <a href="#ks_reactor_ksinputbuffer_getint" id="ks_reactor_ksinputbuffer_getint"></a>

Gets an int from the buffer.

```csharp
public int GetInt()
```

#### Returns

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

Int value.

### GetIntArray() <a href="#ks_reactor_ksinputbuffer_getintarray" id="ks_reactor_ksinputbuffer_getintarray"></a>

Get an array of ints from the buffer.

```csharp
public int[] GetIntArray()
```

#### Returns

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

Int array.

### GetLong() <a href="#ks_reactor_ksinputbuffer_getlong" id="ks_reactor_ksinputbuffer_getlong"></a>

Gets a long from the buffer.

```csharp
public long GetLong()
```

#### Returns

[long](https://learn.microsoft.com/dotnet/api/system.int64)

Long value.

### GetLongArray() <a href="#ks_reactor_ksinputbuffer_getlongarray" id="ks_reactor_ksinputbuffer_getlongarray"></a>

Get an array of longs from the buffer.

```csharp
public long[] GetLongArray()
```

#### Returns

[long](https://learn.microsoft.com/dotnet/api/system.int64)\[]

Long array.

### GetMultiType() <a href="#ks_reactor_ksinputbuffer_getmultitype" id="ks_reactor_ksinputbuffer_getmultitype"></a>

Get a ksMultitype from the buffer. This decodes the multitype using the legacy format from Reactor 1.0.3 and earlier.

```csharp
public ksMultiType GetMultiType()
```

#### Returns

[ksMultiType](/reactor/api-reference/ks.reactor/ks.reactor.ksmultitype.md)

ksMultitype value.

### GetShort() <a href="#ks_reactor_ksinputbuffer_getshort" id="ks_reactor_ksinputbuffer_getshort"></a>

Gets a short from the buffer.

```csharp
public short GetShort()
```

#### Returns

[short](https://learn.microsoft.com/dotnet/api/system.int16)

Short value.

### GetShortArray() <a href="#ks_reactor_ksinputbuffer_getshortarray" id="ks_reactor_ksinputbuffer_getshortarray"></a>

Get an array of shorts from the buffer.

```csharp
public short[] GetShortArray()
```

#### Returns

[short](https://learn.microsoft.com/dotnet/api/system.int16)\[]

Short array.

### GetString() <a href="#ks_reactor_ksinputbuffer_getstring" id="ks_reactor_ksinputbuffer_getstring"></a>

Gets a string from the buffer.

```csharp
public string GetString()
```

#### Returns

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

String value.

### GetStringArray() <a href="#ks_reactor_ksinputbuffer_getstringarray" id="ks_reactor_ksinputbuffer_getstringarray"></a>

Get an array of strings from the buffer.

```csharp
public string[] GetStringArray()
```

#### Returns

[string](https://learn.microsoft.com/dotnet/api/system.string)\[]

String array.

### GetUInt() <a href="#ks_reactor_ksinputbuffer_getuint" id="ks_reactor_ksinputbuffer_getuint"></a>

Gets a uint from the buffer.

```csharp
public uint GetUInt()
```

#### Returns

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

Uint value.

### GetUIntArray() <a href="#ks_reactor_ksinputbuffer_getuintarray" id="ks_reactor_ksinputbuffer_getuintarray"></a>

Get an array of uints from the buffer.

```csharp
public uint[] GetUIntArray()
```

#### Returns

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

Uint array.

### GetULong() <a href="#ks_reactor_ksinputbuffer_getulong" id="ks_reactor_ksinputbuffer_getulong"></a>

Gets a ulong from the buffer.

```csharp
public ulong GetULong()
```

#### Returns

[ulong](https://learn.microsoft.com/dotnet/api/system.uint64)

Ulong value.

### GetULongArray() <a href="#ks_reactor_ksinputbuffer_getulongarray" id="ks_reactor_ksinputbuffer_getulongarray"></a>

Get an array of ulongs from the buffer.

```csharp
public ulong[] GetULongArray()
```

#### Returns

[ulong](https://learn.microsoft.com/dotnet/api/system.uint64)\[]

Ulong array.

### GetUShort() <a href="#ks_reactor_ksinputbuffer_getushort" id="ks_reactor_ksinputbuffer_getushort"></a>

Gets a ushort from the buffer.

```csharp
public ushort GetUShort()
```

#### Returns

[ushort](https://learn.microsoft.com/dotnet/api/system.uint16)

Ushort value.

### GetUShortArray() <a href="#ks_reactor_ksinputbuffer_getushortarray" id="ks_reactor_ksinputbuffer_getushortarray"></a>

Get an array of ushorts from the buffer.

```csharp
public ushort[] GetUShortArray()
```

#### Returns

[ushort](https://learn.microsoft.com/dotnet/api/system.uint16)\[]

Ushort array.

### Reset() <a href="#ks_reactor_ksinputbuffer_reset" id="ks_reactor_ksinputbuffer_reset"></a>

Reset the internal position to the beginning of the array.

```csharp
public void Reset()
```
