public virtual id InitWithStream(NSInputStream aStream)
        {
            id self = this;

             NSInputStream stream = InitForIncrementalParsing(aStream);
             if (stream != null)
             {
                 _reserved1.parserFlags |= 0x80;
                 _reserved3 = stream;
             }

             return self;
        }
 protected virtual NSInputStream InitForIncrementalParsing(NSInputStream stream)
 {
     id self = this.InitWithData(null);
     if (self != null)
     {
         //_reserved1.parserFlags = _reserved1.parserFlags & 0xffffffffffffff7f;
     }
     return stream;
 }
        public virtual id InitWithData(NSData data)
        {
            id self = this;

            SetupLibXml();

            if (base.Init() != null)
            {
                _reserved1 = (NSXMLParserInfo)NSXMLParserInfo.Alloc().Init();

                _reserved1.saxHandler = new LibXml.xmlSAXHandler();
                _xmlStructuredErrorFuncPtr = Marshal.GetFunctionPointerForDelegate(new LibXml.xmlStructuredErrorFunc(_StructuredErrorFunc));

                _reserved1.parserContext = IntPtr.Zero;
                _reserved1.error = null;
                _reserved1.parserFlags = 0;
                _reserved1.slowStringMap = (NSMapTable)NSMapTable.Alloc().Init();

                InitializeSAX2Callbacks();
                _reserved1.parserFlags |= 0x40;
                _reserved1.parserFlags |= 0x80;

                if (data != null)
                {
                    _reserved3 = NSInputStream.InputStreamWithData(data);
                    if (data.Length < 0x100000)
                        _reserved1.chunkSize = data.Length;
                    else
                        _reserved1.chunkSize = 0x100000 * 256;
                }
            }

            return self;
        }