public void Dispose() { if (mStream != null) { mStream.ChangeByteOrder(mOldByteOrder); } }
/// <summary></summary> /// <param name="s"></param> /// <param name="requiresSwitch">Is there an actual order switch even occurring?</param> public EndianFormatSwitchBlock(EndianWriter s, bool requiresSwitch) { mStream = requiresSwitch ? s : null; if (requiresSwitch) // if not, don't do anything but keep the IDisposable wheel turning { mOldByteOrder = s.ByteOrder; mOldRequiresByteSwap = s.mRequiresByteSwap; s.ChangeByteOrder(mOldByteOrder.Invert()); } }