in src/com/pty4j/windows/winpty/NamedPipe.java [150:164]
public int available() throws IOException {
readLock.lock();
try {
if (shutdownFlag) {
return -1;
}
peekActual.setValue(0);
if (!KERNEL32.PeekNamedPipe(myHandle, null, 0, null, peekActual, null)) {
throw new IOException("PeekNamedPipe failed");
}
return peekActual.getValue();
} finally {
readLock.unlock();
}
}