public void update(AgentUpdateGrinderMessage message) throws CommunicationException {
		if (message.getOffset() != offset) {
			throw new CommunicationException("Expected " + offset + " offset," +
					" but " + message.getOffset() + " was sent. " + ToStringBuilder.reflectionToString(message));
		}
		try {
			IOUtils.write(message.getBinary(), agentOutputStream);
			offset = message.getNext();
		} catch (IOException e) {
			throw new CommunicationException("Error while writing binary", e);
		}
		if (message.getNext() == 0) {
			IOUtils.closeQuietly(agentOutputStream);
			decompressDownloadPackage();
			// Then just exist to run the agent update process.
			System.exit(0);
		}
	}
Update agent based on the current message.

@param message message to be sent
ngrinder-core/src/main/java/net/grinder/AgentUpdateHandler.java