private void SetBuffer(Stream stream, byte[] buffer, int offset, int count, IXmlDictionary dictionary, XmlBinaryReaderSession session)
 {
     _stream     = stream;
     _buffer     = buffer;
     _offsetMin  = offset;
     _offset     = offset;
     _offsetMax  = offset + count;
     _dictionary = dictionary;
     _session    = session;
 }
 public void SetBuffer(Stream stream, IXmlDictionary dictionary, XmlBinaryReaderSession session)
 {
     if (_streamBuffer == null)
     {
         _streamBuffer = new byte[128];
     }
     SetBuffer(stream, _streamBuffer, 0, 0, dictionary, session);
     _windowOffset    = 0;
     _windowOffsetMax = _streamBuffer.Length;
 }
 public void Close()
 {
     if (_streamBuffer != null && _streamBuffer.Length > 4096)
     {
         _streamBuffer = null;
     }
     if (_stream != null)
     {
         _stream.Dispose();
         _stream = null;
     }
     _buffer          = Array.Empty <byte>();
     _offset          = 0;
     _offsetMax       = 0;
     _windowOffset    = 0;
     _windowOffsetMax = 0;
     _dictionary      = null;
     _session         = null;
 }
 public void SetBuffer(byte[] buffer, int offset, int count, IXmlDictionary dictionary, XmlBinaryReaderSession session)
 {
     SetBuffer(null, buffer, offset, count, dictionary, session);
 }