prewk / xml-string-streamer

Stream large XML files with low memory consumption.
MIT License
356 stars 49 forks source link

Fix closing tag position detection when not reading from beginning of file #78

Closed dominik-vasicek closed 3 years ago

dominik-vasicek commented 3 years ago

Follow-up of #77

Closing tag position in working blob is being detected no matter the position of the opening one. This creates case where length of string to be flushed might become negative, resulting in flushing all of working blob except x characters, where x is difference in position between opening and closing tag.

This update is made to support seeking through stream without invalid items found.

prewk commented 3 years ago

Thanks! I'm glad we have tests, it's hard to wrap my head around this parsing at a glance.

I'll merge it when I have the chance.

prewk commented 3 years ago

Merged and released 1.2.1