mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(BigEndianReader): refined implementation.
This commit is contained in:
@@ -41,9 +41,10 @@ namespace GameRes.Formats.Cri
|
|||||||
set { m_input.BaseStream.Position = value; }
|
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)
|
public BigEndianReader (Stream input, Encoding enc, bool leave_open = false)
|
||||||
@@ -113,10 +114,17 @@ namespace GameRes.Formats.Cri
|
|||||||
#region IDisposable Members
|
#region IDisposable Members
|
||||||
bool _disposed = false;
|
bool _disposed = false;
|
||||||
public void Dispose ()
|
public void Dispose ()
|
||||||
|
{
|
||||||
|
Dispose (true);
|
||||||
|
GC.SuppressFinalize (this);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void Dispose (bool disposing)
|
||||||
{
|
{
|
||||||
if (!_disposed)
|
if (!_disposed)
|
||||||
{
|
{
|
||||||
m_input.Dispose();
|
if (disposing)
|
||||||
|
m_input.Dispose();
|
||||||
_disposed = true;
|
_disposed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user