/** * Converts the byte array to a simple message. * Assumes that the byte array is a message. * @return a message containing the data specified in the byte stream */ private OSCMessage convertMessage(final Input rawInput) { final OSCMessage message = new OSCMessage(); message.setAddress(readString(rawInput)); final CharSequence types = readTypes(rawInput); for (int ti = 0; ti < types.length(); ++ti) { if ('[' == types.charAt(ti)) { // we're looking at an array -- read it in message.addArgument(readArray(rawInput, types, ++ti)); // then increment i to the end of the array while (types.charAt(ti) != ']') { ti++; } } else { message.addArgument(readArgument(rawInput, types.charAt(ti))); } } return message; }