mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-11 19:12:31 +02:00
043770ca12
* (Fix) phz: Files with encryption or sliced by chitubox produced black images after save due not setting the image address nor size (Spotted by Burak Cezairli)
30 lines
868 B
C#
30 lines
868 B
C#
/*
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE
|
|
* Version 3, 19 November 2007
|
|
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
* Everyone is permitted to copy and distribute verbatim copies
|
|
* of this license document, but changing it is not allowed.
|
|
*/
|
|
|
|
using System.IO;
|
|
|
|
namespace UVtools.Core.Extensions
|
|
{
|
|
public static class StreamExtensions
|
|
{
|
|
/// <summary>
|
|
/// Converts stream into byte array
|
|
/// </summary>
|
|
/// <param name="stream">Input</param>
|
|
/// <returns>Byte array data</returns>
|
|
public static byte[] ToArray(this Stream stream)
|
|
{
|
|
using (var memoryStream = new MemoryStream())
|
|
{
|
|
stream.CopyTo(memoryStream);
|
|
return memoryStream.ToArray();
|
|
}
|
|
}
|
|
}
|
|
}
|