From: John M. <jo...@eb...> - 2014-04-11 08:13:43
|
Hi Lochana, You need to close the buffer before getting the output. J public static String toSDfileString(List<IAtomContainer> ms) throws IOException, CDKException { StringWriter sw = new StringWriter(); SDFWriter sdw = new SDFWriter(sw); for (IAtomContainer m : ms){ sdw.write(ia); } sdw.close(); // String sdfString = sw.toString(); // needs to be after close return sw.toString(); } |