feat: Expose wrapped stream for IcdStreamReader

This commit is contained in:
Austin Noska
2021-04-28 17:03:59 -04:00
parent 40330d0007
commit 5aca963da0

View File

@@ -11,6 +11,10 @@ namespace ICD.Common.Utils.IO
{
private readonly StreamReader m_StreamReader;
public StreamReader WrappedStreamReader { get { return m_StreamReader; } }
public bool EndOfStream { get { return m_StreamReader.EndOfStream; } }
/// <summary>
/// Constructor.
/// </summary>
@@ -23,6 +27,21 @@ namespace ICD.Common.Utils.IO
m_StreamReader = new StreamReader(memoryStream.WrappedMemoryStream);
}
/// <summary>
/// Constructor.
/// </summary>
/// <param name="path"></param>
public IcdStreamReader(string path)
{
if (path == null)
throw new ArgumentNullException("path");
if (!IcdFile.Exists(path))
throw new FileNotFoundException("Error creating stream reader, file not found");
m_StreamReader = new StreamReader(path);
}
~IcdStreamReader()
{
Dispose();
@@ -37,5 +56,10 @@ namespace ICD.Common.Utils.IO
{
m_StreamReader.Dispose();
}
public string ReadLine()
{
return m_StreamReader.ReadLine();
}
}
}