Exemple #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();
 }
Exemple #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();
            }
        }