private byte[] readInputStreamSlowMode(InputStream is) {
		boolean lastByteWasReturnByte = false;
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		try {
			while (true) {
				int intB = is.read();
				byte b = (byte) intB;

				/**
				 * prevent OutOfMemory exceptions, per leopoldkot
				 */
				if (intB == -1) {
					throw new BeanstalkException("The end of InputStream is reached");
				}

				if (b == '\n' && lastByteWasReturnByte) {
					break;
				}
				if (b == '\r') {
					lastByteWasReturnByte = true;
				} else {
					if (lastByteWasReturnByte) {
						lastByteWasReturnByte = false;
						baos.write('\r');
					}
					baos.write(b);
				}
			}
			return baos.toByteArray();
		} catch (Exception e) {
			throw new BeanstalkException(e.getMessage());
		}
	}