private static byte encodeMessageType(MessageType messageType) {
		switch(messageType) {
			case APPLICATION:
				return Packet.MESSAGE_TYPE_APPLICATION;
			case PING:
				return Packet.MESSAGE_TYPE_PING;
			case PING_RESPONSE:
				return Packet.MESSAGE_TYPE_PING_RESPONSE;
			case CONNECT_REQUEST:
				return Packet.MESSAGE_TYPE_CONNECT_REQUEST;
			case CONNECTION_ACCEPTED:
				return Packet.MESSAGE_TYPE_CONNECTION_ACCEPTED;
			case CONNECTION_REFUSED:
				return Packet.MESSAGE_TYPE_CONNECTION_REFUSED;
			case FORCE_DISCONNECT:
				return Packet.MESSAGE_TYPE_FORCE_DISCONNECT;
			case CLIENT_DISCONNECT:
				return Packet.MESSAGE_TYPE_CLIENT_DISCONNECT;
			default:
				return Packet.MESSAGE_TYPE_INVALID;
		}
	}