Beispiel #1
0
 static CStreamWriter()
 {
     // This is a somewhat ugly way to create an empty CStream -- using the Null Object
     // pattern (see GOF) would look better. However it is the easiest workaround.
     CStreamWriter.Empty = new CStreamWriter(0);
     CStreamWriter.Empty.Close();
 }
Beispiel #2
0
        /// <summary>
        /// Create a reader to read from the passed CStream.
        /// </summary>
        public CStreamReader(CStreamWriter writer)
        {
            _writer = writer;

            _writer.SwapEvent += swapHandler;

            if (_writer.IsSwapped)
            {
                swapHandler();
            }
        }