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.
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