Code example for StringWriter

Methods: flushtoString

	public void objectSerializationTest(){ 
		try { 
			ConciseBoundedDescriptionGenerator modelGen = new ConciseBoundedDescriptionGeneratorImpl(SparqlEndpoint.getEndpointDBpediaLiveAKSW());
			Model model = modelGen.getConciseBoundedDescription("", 2);
			StringWriter sw = new StringWriter();
			model.write(sw, "TURTLE");
			String modelString = sw.toString();
			File f = new File("model.txt");
			Files.writeObjectToFile(modelString, f);
			long startTime = System.currentTimeMillis();
			modelString = (String) Files.readObjectfromFile(f);
			model = ModelFactory.createDefaultModel(); StringReader(modelString), null, "TURTLE");
			ExtractionDBCache cache = new ExtractionDBCache("cache");
		} catch (Exception e) {
Connect your IDE to all the code out there  Get Codota for Java