mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-27 21:34:14 +08:00
(BigEndianReader): refined implementation.
This commit is contained in:
parent
6878d1c21e
commit
20c1137669
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user