I don't ScopedJavaLocalRef is required here, as buffer will be passed to the Java function as a argument, the string will be released by the Java function automatically.