I have a JNI function "byte [] read ()" that reads some bytes from a specific hardware interface and returns every new byte every time it is called. Read data is always ASCII text data and has "\ n" to end the line.
I would like to convert these arrays of MULTIPLE arrays read from a function into an InputStream so that I can print them line by line.
Sort of:
while(running) { byte[] in = read(); // Can very well return in complete line SomeInputStream.setMoreIncoming(in); if(SomeInputStream.hasLineData()) System.out.println(SomeInputSream.readline()); }
How to do it?
source share