Dispose() public method

Disposes of this instance, potentially closing any underlying stream.
As there is no flushing to perform here, disposing of a CodedInputStream which was constructed with the leaveOpen option parameter set to true (or one which was constructed to read from a byte array) has no effect.
public Dispose ( ) : void
return void
示例#1
0
        /// <summary>
        /// clear Pool
        /// </summary>
        public static void PoolDispose()
        {
#if POOL
            if (_sharedInputSteam != null)
            {
                _sharedInputSteam.Dispose();
                _sharedInputSteam = null;
            }

            if (_sharedOutSteam != null)
            {
                _sharedOutSteam.Dispose();
                _sharedOutSteam = null;
            }
#endif
        }
        public void Dispose_FromByteArray()
        {
            var stream = new CodedInputStream(new byte[10]);

            stream.Dispose();
        }
示例#3
0
 public void Dispose_WithByteArray()
 {
     var cis = new CodedInputStream(new byte[0]);
     Assert.DoesNotThrow(() => cis.Dispose());
 }