mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
42 lines
743 B
C#
42 lines
743 B
C#
using System;
|
|
#if SIMPLSHARP
|
|
using Crestron.SimplSharp.CrestronIO;
|
|
#elif STANDARD
|
|
using System.IO;
|
|
#endif
|
|
|
|
namespace ICD.Common.Utils.IO
|
|
{
|
|
public sealed class IcdStreamReader : IDisposable
|
|
{
|
|
private readonly StreamReader m_StreamReader;
|
|
|
|
/// <summary>
|
|
/// Constructor.
|
|
/// </summary>
|
|
/// <param name="memoryStream"></param>
|
|
public IcdStreamReader(IcdMemoryStream memoryStream)
|
|
{
|
|
if (memoryStream == null)
|
|
throw new ArgumentNullException("memoryStream");
|
|
|
|
m_StreamReader = new StreamReader(memoryStream.WrappedMemoryStream);
|
|
}
|
|
|
|
~IcdStreamReader()
|
|
{
|
|
Dispose();
|
|
}
|
|
|
|
public string ReadToEnd()
|
|
{
|
|
return m_StreamReader.ReadToEnd();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
m_StreamReader.Dispose();
|
|
}
|
|
}
|
|
}
|