> 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.ksstreambuffer/ks.reactor.ksstreambuffer.segment.md).

# Class ksStreamBuffer.Segment

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

Represents a segment of a ksStreamBuffer. While a segment is not released, the buffer cannot be written to or released.

```csharp
public class ksStreamBuffer.Segment
```

#### Inheritance

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

## Properties

### Array <a href="#ks_reactor_ksstreambuffer_segment_array" id="ks_reactor_ksstreambuffer_segment_array"></a>

Byte array managed by the segment.

```csharp
public byte[] Array { get; }
```

#### Property Value

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

### Count <a href="#ks_reactor_ksstreambuffer_segment_count" id="ks_reactor_ksstreambuffer_segment_count"></a>

Size of the buffer segment.

```csharp
public int Count { get; }
```

#### Property Value

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

### Offset <a href="#ks_reactor_ksstreambuffer_segment_offset" id="ks_reactor_ksstreambuffer_segment_offset"></a>

Offset in the referenced byte array.

```csharp
public int Offset { get; }
```

#### Property Value

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

## Methods

### Release() <a href="#ks_reactor_ksstreambuffer_segment_release" id="ks_reactor_ksstreambuffer_segment_release"></a>

Releases the segement back to the buffer.

```csharp
public void Release()
```

### ToString() <a href="#ks_reactor_ksstreambuffer_segment_tostring" id="ks_reactor_ksstreambuffer_segment_tostring"></a>

Gets a string showing the offset and count.

```csharp
public override string ToString()
```

#### Returns

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

String with offset and count.
