@Override
	protected void writeMessage(OutputStream out) throws IOException {
		out.write(0x00);
		switch (status) {
		case ACCEPTED:
			out.write(0x00);
			break;
		case UNACCEPTABLE_PROTOCOL_VERSION:
			out.write(0x01);
			break;
		case IDENTIFIER_REJECTED:
			out.write(0x02);
			break;
		case SERVER_UNAVAILABLE:
			out.write(0x03);
			break;
		case BAD_USERNAME_OR_PASSWORD:
			out.write(0x04);
			break;
		case NOT_AUTHORIZED:
			out.write(0x05);
			break;
		default:
			throw new UnsupportedOperationException(
					"Unsupported CONNACK code: " + status);
		}
	}