Skip to content

Commit

Permalink
modified to avoid InputStreamReader.ready() method
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
vedina authored and rajarshi committed Oct 16, 2010
1 parent 4083956 commit f0730f8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main/org/openscience/cdk/io/iterator/IteratingMDLReader.java
Expand Up @@ -134,19 +134,16 @@ public boolean hasNext() {

// now try to parse the next Molecule
try {
if (input.ready()) {
if ((currentLine = input.readLine()) != null) {
currentFormat = (IChemFormat)MDLFormat.getInstance();
currentLine = input.readLine();
StringBuffer buffer = new StringBuffer();
while (currentLine != null && !currentLine.equals("M END")) {
// still in a molecule
buffer.append(currentLine);
buffer.append(System.getProperty("line.separator"));
if (input.ready()) {
currentLine = input.readLine();
} else {
currentLine = null;
}

currentLine = input.readLine();

// do MDL molfile version checking
if (currentLine.contains("V2000") || currentLine.contains("v2000")) {
currentFormat = (IChemFormat)MDLV2000Format.getInstance();
Expand Down

0 comments on commit f0730f8

Please sign in to comment.