java - jena read inputstream from gzipped file -


i have following code read dataset jena model using inputstream program able read compressed (gzipped) files (using filepath).

dataset dataset = tdbfactory.createdataset(tdbpath); model model = dataset.getdefaultmodel(); inputstream str = filemanager.get().open(filepath); model.read(str,null, "n-triples");   

you need create gzipinputstream read then

dataset dataset = tdbfactory.createdataset(tdbpath); model model = dataset.getdefaultmodel(); inputstream str = filemanager.get().open(filepath); if (usegzip) {    str = new gzipinputstream(str); } model.read(str,null, "n-triples");   

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -