Menu

#3 VTDGen should support reading from streams, not just files

2.0
pending
None
2016-06-14
2014-11-22
No

All the parse methods accept filenames (except the parse(boolean) method which I don't understand). But I have a use case where I am pulling messages off a queue. I want to feed these directly into the VTD parser as bytes or a UTF-8 string, not write it to file first.

The parseFile method already reads from an FileInputStream internally so it wouldn't be hard to expose a parse(InputStream) method.

Discussion

  • jimmy zhang

    jimmy zhang - 2016-06-13

    The key issue with vtd-xml is that it is not a stream based parser, it is instead based on an array of bytes, or a segment in an array of bytes... so when interfacing with a stream, you need to tell the parser the number of bytes to read a priori... directly passing a stream to parse in general won't work well... consider the case where the xml length exceeds 2gb, exceeding vtd-xml's limit... so you need a little bit of interface code with a stream... which is customized to suit your particular production environment... btw, sorry for taking so long... I had trouble with sf's bug reporting system...

     

    Last edit: jimmy zhang 2016-06-13
  • jimmy zhang

    jimmy zhang - 2016-06-14
    • status: open --> pending
    • assigned_to: jimmy zhang
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.