Skip to content

easyextensions StreamExtensions

BigMakCode edited this page Aug 5, 2024 · 1 revision

StreamExtensions Public class

Description

Stream extensions.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph EasyExtensions
  EasyExtensions.StreamExtensions[[StreamExtensions]]
  end
Loading

Members

Methods

Public Static methods

Returns Name
byte``[] ReadToEnd(Stream stream)
Reads the bytes from the current stream and writes them to the byte array.
Task<byte``[]> ReadToEndAsync(Stream stream)
Asynchronously reads the bytes from the current stream and writes them to the byte array.
string SHA512(Stream stream)
Calculate SHA512 hash of byte stream.

Details

Summary

Stream extensions.

Methods

ReadToEnd

public static byte ReadToEnd(Stream stream)
Arguments
Type Name Description
Stream stream
Summary

Reads the bytes from the current stream and writes them to the byte array.

Returns

Received byte array.

Exceptions
Name Description
IOException An I/O error occurred.
ArgumentNullException Destination is null.
ObjectDisposedException Either the current stream or the destination stream is disposed.
NotSupportedException The current stream does not support reading, or the destination stream does not support writing.

ReadToEndAsync

public static async Task<byte> ReadToEndAsync(Stream stream)
Arguments
Type Name Description
Stream stream
Summary

Asynchronously reads the bytes from the current stream and writes them to the byte array.

Returns

Received byte array.

Exceptions
Name Description
ArgumentNullException Destination is null.
ObjectDisposedException Either the current stream or the destination stream is disposed.
NotSupportedException The current stream does not support reading, or the destination stream does not support writing.

SHA512

public static string SHA512(Stream stream)
Arguments
Type Name Description
Stream stream Data to calculate hash.
Summary

Calculate SHA512 hash of byte stream.

Returns

SHA512 hash of byte stream.

Generated with ModularDoc

Clone this wiki locally