[Back to home](Home) | [Back to Reference](Reference) | [View raw text](GeneratedDocs/Utils.StreamExtensions.md)
# StreamExtensions `class`
## Description
Extension methods for Streams. This file is not utilized in SolidShineUi at all, and will be removed in a future version.
## Diagram
```mermaid
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph SolidShineUi.Utils
SolidShineUi.Utils.StreamExtensions[[StreamExtensions]]
end
```
## Members
### Methods
#### Public Static methods
| Returns | Name |
| --- | --- |
| `string` | [`ReadAsciiString`](#readasciistring)(`Stream` stream, `int` length)
Reads a ASCII string of the specified length. |
| `string` | [`ReadStringBigEndian`](#readstringbigendian-12)(`...`)
Reads a unicode string of the specified length in big-endian format. |
| `int` | [`ReadUInt16BigEndian`](#readuint16bigendian)(`Stream` stream)
Reads a 2-byte unsigned integer from the current stream using big-endian encoding and advances the position of the stream by two bytes. |
| `int` | [`ReadUInt32BigEndian`](#readuint32bigendian)(`Stream` stream)
Reads a 4-byte unsigned integer from the current stream using big-endian encoding and advances the position of the stream by four bytes. |
## Details
### Summary
Extension methods for Streams. This file is not utilized in SolidShineUi at all, and will be removed in a future version.
### Methods
#### ReadAsciiString
```csharp
public static string ReadAsciiString(Stream stream, int length)
```
##### Arguments
| Type | Name | Description |
| --- | --- | --- |
| `Stream` | stream | The stream to read the data from. |
| `int` | length | The number of characters in the string. |
##### Summary
Reads a ASCII string of the specified length.
##### Returns
The string read from the stream.
#### ReadStringBigEndian [1/2]
```csharp
public static string ReadStringBigEndian(Stream stream, int length)
```
##### Arguments
| Type | Name | Description |
| --- | --- | --- |
| `Stream` | stream | The stream to read the data from. |
| `int` | length | The number of characters in the string. |
##### Summary
Reads a unicode string of the specified length in big-endian format.
##### Returns
The string read from the stream.
#### ReadStringBigEndian [2/2]
```csharp
public static string ReadStringBigEndian(Stream stream)
```
##### Arguments
| Type | Name | Description |
| --- | --- | --- |
| `Stream` | stream | The stream to read the data from. |
##### Summary
Reads a unicode string from the current stream in big-endian format. The string is prefixed with the length.
##### Returns
The string read from the stream.
#### ReadUInt16BigEndian
```csharp
public static int ReadUInt16BigEndian(Stream stream)
```
##### Arguments
| Type | Name | Description |
| --- | --- | --- |
| `Stream` | stream | The stream to read the data from. |
##### Summary
Reads a 2-byte unsigned integer from the current stream using big-endian encoding and advances the position of the stream by two bytes.
##### Returns
A 2-byte unsigned integer read from the source stream.
#### ReadUInt32BigEndian
```csharp
public static int ReadUInt32BigEndian(Stream stream)
```
##### Arguments
| Type | Name | Description |
| --- | --- | --- |
| `Stream` | stream | The stream to read the data from. |
##### Summary
Reads a 4-byte unsigned integer from the current stream using big-endian encoding and advances the position of the stream by four bytes.
##### Returns
A 4-byte unsigned integer read from the source stream.
*Generated with* [*ModularDoc*](https://github.com/hailstorm75/ModularDoc)