Changeset 6396


Ignore:
Timestamp:
05/26/10 20:24:19 (10 years ago)
Author:
curtis
Message:

Fix bug where readLine and readCString returned "" instead of null at EOF.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/common/src/loci/common/RandomAccessInputStream.java

    r6333 r6396  
    309309  /** Read the next line of text from the input stream. */ 
    310310  public String readLine() throws IOException { 
    311     return findString("\n"); 
     311    String line = findString("\n"); 
     312    return line.length() == 0 ? null : line; 
    312313  } 
    313314 
    314315  /** Read a string of arbitrary length, terminated by a null char. */ 
    315316  public String readCString() throws IOException { 
    316     return findString("\0"); 
     317    String line = findString("\0"); 
     318    return line.length() == 0 ? null : line; 
    317319  } 
    318320 
Note: See TracChangeset for help on using the changeset viewer.