Skip to content

Utils.StreamExtensions

JaykeBird edited this page Feb 21, 2023 · 6 revisions

Back to home | Back to Reference | View raw text

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

  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(Stream stream, int length)
Reads a ASCII string of the specified length.
string ReadStringBigEndian(...)
Reads a unicode string of the specified length in big-endian format.
int 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(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

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]

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]

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

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

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

Clone this wiki locally