Table of Contents

Class StreamUtils

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Contains Stream related static methods.

public static class StreamUtils
Inheritance
StreamUtils

Fields

Empty

Gets an empty stream.

Methods

AreEqual(MemoryStream, MemoryStream)

Compares two memory streams using byte to byte comparison.

AreEqual(Stream, Stream)

Compares two streams using byte to byte comparison.

ConvertBase64ToStream(string)

Converts a Base64 encoded string to a MemoryStream.

ConvertStreamToBase64(MemoryStream)

Converts a MemoryStream to a Base64 encoded string.

CopyStream(Stream, string)

Copies stream to the file with the specified path.

CopyStreamSafe(Stream, string)

Safely copies the content of a stream to a file at the specified destination path. Returns true if the operation succeeds, otherwise false.

CreateMemoryStream(Stream?)

Creates MemoryStream with data copied from the specified stream.

StringFromStream(Stream, Encoding?)

Reads string from Stream using the specified encoding.

StringFromStreamOrNull(Stream?, Encoding?)

Reads a string from the specified stream using the specified encoding. Returns null if the stream is null or if an error occurs during reading.

StringToStream(Stream, string, Encoding?)

Writes string to Stream using the specified encoding.