I would like to access the content of a flow file that should contain binary data but when I execute this code:
public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {
FlowFile ff = session.get();
Logger.info("Flowfile size : " + ff.getSize());
session.read(ff, new InputStreamCallback() {
@Override
public void process(InputStream in) throws IOException {
Logger.info("InputStream size : " + in.available());
…
}
}
}
I have this:
Flowfile size : 46662
InputStream size : 0
As a result, I don’t have any data to read.
Can someone guide me on how to read correctly the flow file content?