java - Using FilterInputStream to drop remainder of an InputStream -


i plan use java process markdown text files specify additional meta information title, author, date of creation etc. @ beginning of document in yaml format. here's example:

--- title: example document author: paul created: 2013-05-19 ---  _body_ of document written in **markdown**. 

for parsing yaml data, use snakeyaml. far can tell, can load yaml documents java.io.inputstream, java.io.reader or string through methods yaml.load() , yaml.loadall() (see the snakeyaml documentation , api).

i don't want use version reads string, since cause performance issues large files. working file inputstream fails, because stream not represent valid yaml document. first part of stream represents valid document.

so question is: how can use java.io.filterinputstream/java.io.filterreader or approach generate stream, stops after second --- overall stream valid yaml?

add "..." (three dots) want yaml parser should stop.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -