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

ReturnsName
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.
stringSHA512(Stream stream)
Calculate SHA512 hash of byte stream.

Details

Summary

Stream extensions.

Methods

ReadToEnd

publicstaticbyteReadToEnd(Streamstream)
Arguments
TypeNameDescription
Streamstream
Summary

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

Returns

Received byte array.

Exceptions
NameDescription
IOExceptionAn I/O error occurred.
ArgumentNullExceptionDestination is null.
ObjectDisposedExceptionEither the current stream or the destination stream is disposed.
NotSupportedExceptionThe current stream does not support reading, or the destination stream does not support writing.

ReadToEndAsync

publicstaticasyncTask<byte>ReadToEndAsync(Streamstream)
Arguments
TypeNameDescription
Streamstream
Summary

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

Returns

Received byte array.

Exceptions
NameDescription
ArgumentNullExceptionDestination is null.
ObjectDisposedExceptionEither the current stream or the destination stream is disposed.
NotSupportedExceptionThe current stream does not support reading, or the destination stream does not support writing.

SHA512

publicstaticstringSHA512(Streamstream)
Arguments
TypeNameDescription
StreamstreamData to calculate hash.
Summary

Calculate SHA512 hash of byte stream.

Returns

SHA512 hash of byte stream.

Generated withModularDoc

Clone this wiki locally