public final String readLine() throws IOException {
        StringBuffer input = new StringBuffer();
        int c = -1;
        boolean eol = false;

        while (!eol) {
            switch (c = read()) {
            case -1:
            case '\n':
                eol = true;
                break;
            case '\r':
                eol = true;
                long cur = getFilePointer();
                if ((read()) != '\n') {
                    seek(cur);
                }
                break;
            default:
                input.append((char)c);
                break;
            }
        }

        if ((c == -1) && (input.length() == 0)) {
            return null;
        }
        return input.toString();
    }
Reads the next line of text from this stream.  This method successively
reads bytes from the stream, starting at the current stream pointer,
until it reaches a line terminator or the end
of the stream.  Each byte is converted into a character by taking the
byte's value for the lower eight bits of the character and setting the
high eight bits of the character to zero.  This method does not,
therefore, support the full Unicode character set.

<p> A line of text is terminated by a carriage-return character
(<code>'&#92;r'</code>), a newline character (<code>'&#92;n'</code>), a
carriage-return character immediately followed by a newline character,
or the end of the stream.  Line-terminating characters are discarded and
are not included as part of the string returned.

<p> This method blocks until a newline character is read, a carriage
return and the byte following it are read (to see if it is a newline),
the end of the stream is reached, or an exception is thrown.

@return     the next line of text from this stream, or null if end
            of stream is encountered before even one byte is read.
@exception  IOException  if an I/O error occurs.
plugins/svg-plugin/batik-codec-fix/src/main/java/org/apache/batik/ext/awt/image/codec/util/SeekableStream.java