public String readit(String pattern) throws InterruptedException, IOException {
		cnt=0;
		char lastChar = pattern.charAt(pattern.length() - 1);
        StringBuffer buffer = new StringBuffer();
        char ch = (char) dataIn.read();
        while (runner==1) {
            buffer.append(ch);
            String msg=buffer.toString().trim();
            if (msg.contains("Room error")){
     			return "Room error";
     		}
        	if (ch == lastChar) {
        		if (buffer.toString().endsWith(pattern)) {
                    return buffer.toString();
                }
            }
            ch = (char) dataIn.read();
            
        }
       	return null;
            
        }