I learn Reactive/Mutiny. I try to use Mutiny to read lines of a file. In imperative way of doing it, it's easy :
public List<String> load(final InputStream inData) throws IOException {
final List<String> content = new ArrayList<>();
final BufferedReader bReader = new BufferedReader(new InputStreamReader(inData, ENCODING));
String text;
while ((text = bReader.readLine()) != null) {
content.add(text);
}
return content;
}
I can't find any example of a reactive way of doing it .. something that would look like :
final BufferedReader bReader = new BufferedReader(new InputStreamReader(inData, ENCODING));
Multi<String> multi = Multi.createFrom(bReader::readline);
Am I totally out of the way ?