private int parseLength(final String fixedString) {
        final int length = fixedString.getBytes().length;
        if (length > 0 && length <= 8) {
            return 8;
        } else if (length > 8 && length <= 16) {
            return 16;
        } else if (length > 16 && length <= 24) {
            return 24;
        } else if (length > 24 && length <= 36) {
            return 36;
        } else if (length > 36 && length <= 64) {
            return 64;
        } else {
            throw new IllegalArgumentException("Invalid length");
        }
    }
FixedString characteristic.

@param fixedString String value
mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/FixedString.java