protected FileRequestResponseMessage handleResponse(InputStream in) throws UnsupportedEncodingException {
		FileRequestResponseMessage try_again = new FileRequestResponseMessage(
				FileRequestResponseMessage.ResponseCode.TRY_AGAIN_LATER, 0);
		int probe_len = FileRequestResponseMessage.TYPE_FIELD.length() + 4;

		byte[] buffer = new byte[probe_len];
		try {
			in.read(buffer, 0, probe_len);
		} catch (IOException e) {
			logger.log(Level.SEVERE, "Could not read response stream: '" + e.getMessage()
					+ "' - assuming 'NEVER TRY AGAIN'");
			return try_again;
		}
		String responseHeader = new String(buffer, Message.ENCODING).trim();
		switch (responseHeader.toUpperCase()) {
		case FileRequestResponseMessage.TYPE_FIELD + Message.FIELD_SEPERATOR + "OK":
			String str_expectedTransferVolume = "";
			int next;
			try {
				while ((next = in.read()) != Message.MESSAGE_SPERATOR)
					if (next == -1) {
						Thread.sleep(500);
					} else {
						str_expectedTransferVolume += new String(new byte[] { (byte) next }, Message.ENCODING);
					}
			} catch (IOException | InterruptedException e) {
				logger.log(Level.SEVERE, "Could not understand response header");
				transferState = TransferStatus.LostConnection;
				closeSocket();
				return null;
			}
			try {
				long expectedTransferVolume = Long.valueOf(str_expectedTransferVolume);
				return new FileRequestResponseMessage(FileRequestResponseMessage.ResponseCode.OK,
						expectedTransferVolume);
			} catch (NumberFormatException ex) {
				logger.log(Level.SEVERE,
						"Response contained invalid 'expected transfer volume' - assuming 'TRY AGAIN LATER'");
				return try_again;
			}
		case FileRequestResponseMessage.TYPE_FIELD + Message.FIELD_SEPERATOR + "TRY":
			logger.log(Level.INFO, "Received 'try again later from host'");
			return try_again;
		case FileRequestResponseMessage.TYPE_FIELD + Message.FIELD_SEPERATOR + "NEV":
			logger.log(Level.INFO, "Received 'never try agiain from host'");
			return new FileRequestResponseMessage(FileRequestResponseMessage.ResponseCode.NEVER_TRY_AGAIN, 0);
		default:
			logger.log(Level.INFO, "Received garbage: '" + responseHeader + "'");
			return try_again;
		}
	}