Code example for ByteArrayOutputStream

Methods: toString

0
	// TODO: Danny: Use the function and then remove the warning suppression 
	@SuppressWarnings("unused") 
	private static String toString(Tool model) throws JAXBException
	{ 
		// save to xml (FIXME: now print only) 
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		JAXBContext jaxbContext = JAXBContext.newInstance("org.molgenis.language.jaxb");
		Marshaller marshaller = jaxbContext.createMarshaller();
		marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
		marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
		marshaller.marshal(model, out);
		return out.toString().trim();
	} 
 
	private static List<File> getFilesRecursive(final File f) throws IOException
	{ 
		List<File> files = new ArrayList<File>();
 
		if (f.isDirectory())
		{ 
Connect your IDE to all the code out there  Get Codota for Java