buffer.append((byte)ch);
buffer.append((char)ch);
    protected String readLine() throws IOException {        decodedIndex = 0;        // get an accumulator for the data        StringBuffer buffer = new StringBuffer();        // now process a character at a time.        int ch = in.read();        while (ch != -1) {            // a naked new line completes the line.            if (ch == '\n') {                break;            }            // a carriage return by itself is ignored...we're going to assume that this is followed            // by a new line because we really don't have the capability of pushing this back .            else if (ch == '\r') {                ;            }            else {                // add this to our buffer                buffer.append((byte)ch);            }            ch = in.read();        }        // if we didn't get any data at all, return nothing        if (ch == -1 && buffer.length() == 0) {            return null;        }        // convert this into a string.        return buffer.toString();    }