private String readline(InputStream is) {
        StringBuilder rtn = new StringBuilder();
        int temp;
        do {
            try {
                temp = is.read();
            } catch (Exception e) {
                return null;
            }
            if (temp == -1) {
                String str = rtn.toString();
                if (str.length() == 0) {
                    return null;
                }
                return str;
            }
            if (temp != 0 && temp != '\n' && temp != '\r') {
                rtn.append((char) temp);
            }
        } while (temp != '\n' && temp != '\r');
        return rtn.toString();
    }