session.read(flowFile, new InputStreamCallback() {
@Override
public void process(final InputStream in) throws IOException {
final InputStream bin = new BufferedInputStream(in);
System.out.println(bin);
}
});
讀出來的內容總是空的。
想要讀取到內容,可以採取一下方法
System.out.println(IOUtils.toString(in,Charset.defaultCharset()));
不過想要引入apache的common-io包
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>