I observed the same behavior as this.. http://sourceforge.net/p/cdk/bugs/1197/ 


  public static String iAtomContainerListToSDFString(List<IAtomContainer> 
mfSDF) throws FileNotFoundException, CDKException, IOException 
    {  
     StringWriter sw = new StringWriter();
     BufferedWriter bw = new BufferedWriter(sw,2);
     SDFWriter sdfW = new SDFWriter(bw);
     for (IAtomContainer ia : mfSDF)
     {
     sdfW.write(ia);
     }
     String sdfString = sw.toString();
     sw.close();
     bw.close();
     sdfW.close(); 
     System.out.println(sdfString);
     return sdfString;
    }

This works, but if I use StringWriter without BufferedWriter it doesn't work. 
Also, If I use a large buffer size, the sdfString is either empty or without 
properties.

I am using CDK 1.4.19 
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to