Beispiel #1
0
 public void Dispose()
 {
     if (mStream != null)
     {
         mStream.ChangeByteOrder(mOldByteOrder);
     }
 }
Beispiel #2
0
            /// <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());
                }
            }