Package java.io
Class PipedInputStream
Description:
It returns the number of bytes that can be read from this input stream without blocking.
Example
PipedOutputStream pos = new PipedOutputStream();
PipedInputStream pis = new PipedInputStream(pos);
byte[] b = {10,20};
pos.write(b, 0, 2);
if (pis.available() > 0)
Console.println("read data: " + pis.read());
The available method checks if data can be read.