Reading line by line strings from multiple byte arrays in Java
<p>I have a JNI function "byte[] read()" which reads some bytes from a particular hardware interface and returns a new byte array each time it is called. The read data is always ASCII text data and has '\n' for line termination.</p>

<p>I'd like to convert these MULTIPLE byte arrays read from the function into an InputStream so I may print them line by line.</p>

<p>Something like:</p>

<pre><code>while(running) {
    byte[] in = read(); // Can very well return in complete line
    SomeInputStream.setMoreIncoming(in);
    if(SomeInputStream.hasLineData())
        System.out.println(SomeInputSream.readline());
}
</code></pre>

<p>How do I do that?</p>
