Class StreamUtils
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.
- 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.