On Oct 21, lochana menikarachchi wrote:
> Here is the code that writes the SDF and incomplete SDF file written.. Am I
> doing something wrong?? Last 2 or 3 structures are never written
> 
>     public static void writeSDF() throws IOException, CDKException
>     {
>         String filename = "/Users/lochana/Desktop/test.sdf";
>         SDFWriter writer = new SDFWriter(new FileWriter(new File(filename)));
>         for (IAtomContainer ac : compounds) {
>             writer.write(ac);
>         }
>         System.out.println("Done!");
>     }

You've to close the writer object when finished (with writer.close()
method).  Java does not close file streams automatically and if the
output stream has some written data that is still buffered in memory
then it will be lost.

Best wishes,
Sulev

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to