class MessageDataExtractor {

    public MessageData getMessageData(byte[] payload) {
        String dataString = new String(payload, StandardCharsets.UTF_8);
        int separator = dataString.indexOf(':');
        return new MessageData(dataString.substring(0, separator), dataString.substring(separator + 1, dataString.length()));
    }

}