Hi,
I tried this with different versions of CDK, by the way.
I used 1.2.7, 1.3.0 and 1.3.6 as jar files in the classpath.
Tobias
On Fri, Oct 15, 2010 at 10:56 AM, Tobias Girschick <
[email protected]> wrote:
> Hi,
>
> We have been using the CDK IteratingMDLReader quite successful for some
> time now. But suddenly, it does not work anymore. I figured out that it
> is due to changing stuff around the cdk code...so far so good. After
> some time I noticed that the Stream I give to the IteratingMDLReader has
> changed. The working one was a java.io.PushbackInputStream, the new one
> is a org.restlet.engine.http.io.ChunkedInputStream. Both extend the
> java.io.InputStream class. Another difference I noticed, is that calling
> the available() method on the PushbackInputStream results in 1, on the
> ChunkedInputStream it results in 0. That's the fact I figured out so
> far. The code fragments around the Reader:
>
> InputStream n = r.getStream();
> // those statements made me figure out what changed:
> System.out.println("[GET2] available: "+in.available());
> System.out.println("[GET2] available: "+in.toString());
>
> IteratingMDLReader sdfreader = new IteratingMDLReader(in,
> DefaultChemObjectBuilder.getInstance());
>
> try {
> if(in != null){
> while (sdfreader.hasNext()) {
> IMolecule mol2store = (IMolecule)sdfreader.next();
> AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol2store);
> CDKHueckelAromaticityDetector.detectAromaticity(mol2store);
> System.out.println("MolAtomCount: " + mol2store.getAtomCount());
> mols.add(mol2store);
> }
> }
> }catch(Exception e){
> e.printStackTrace();
> }finally{
> sdfreader.close();
> in.close();
> }
>
> The contents of the chunked stream seems to be fine...it works with
> JOELIB2 (joelib2.io.BasicReader) and it works if I write the stream to a
> file and then import it with the IteratingMDLReader.
>
> Any clues? This is quite important for us to work. At the moment we have
> a little workaround but I'd like to change that.
>
> best regards,
> Tobias
>
>
> --
> Dipl.-Bioinf. Tobias Girschick
>
> Technische Universität München
> Institut für Informatik
> Lehrstuhl I12 - Bioinformatik
> Bolzmannstr. 3
> 85748 Garching b. München, Germany
>
> --
> Tobias Girschick
> mailto: [email protected]
>
--
Tobias Girschick
mailto: [email protected]
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user