mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
feat: Expose wrapped stream for IcdStreamReader
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user