(BigEndianReader): refined implementation.

This commit is contained in:
morkt 2016-03-09 11:11:17 +04:00
parent 6878d1c21e
commit 20c1137669

View File

@ -41,9 +41,10 @@ namespace GameRes.Formats.Cri
set { m_input.BaseStream.Position = value; }
}
public BigEndianReader(Stream input)
public Stream BaseStream { get { return m_input.BaseStream; } }
public BigEndianReader (Stream input) : this (input, Encoding.UTF8, false)
{
m_input = new BinaryReader (input, Encoding.UTF8, false);
}
public BigEndianReader (Stream input, Encoding enc, bool leave_open = false)
@ -113,10 +114,17 @@ namespace GameRes.Formats.Cri
#region IDisposable Members
bool _disposed = false;
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void Dispose (bool disposing)
{
if (!_disposed)
{
m_input.Dispose();
if (disposing)
m_input.Dispose();
_disposed = true;
}
}