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
Post a Comment