Exemple #1
0
        public void Dispose()
        {
            if (fromPool)
            {
                if (bufferOwner != null)
                {
                    buffer.Clear();
                    BufferArrayPool <byte> .Return(bufferOwner);

                    bufferOwner = null;
                    buffer      = null;
                }
            }
        }
Exemple #2
0
        public void Dispose()
        {
            if (streamBufferOwner != null)
            {
                streamBuffer.Clear();
                BufferArrayPool <char> .Return(streamBufferOwner);

                streamBufferOwner = null;
                streamBuffer      = null;
            }
            if (stream != null)
            {
                stream.Dispose();
            }
        }