static int checkAck(InputStream in) throws IOException {
		int b = in.read();

		if (b == 0)
			return b;
		if (b == -1)
			return b;

		if (b == ERROR || b == FATAL_ERROR) {
			StringBuffer sb = new StringBuffer();
			int c;
			do {
				c = in.read();
				sb.append((char) c);
			} while (c != '\n');
			if (b == ERROR) {
				log.error(sb.toString());
			}
			if (b == FATAL_ERROR) {
				log.error(sb.toString());
			}
		}
		return b;
	}