public ByteBuffer waitForOutput(long time,TimeUnit unit) throws InterruptedException
{
ByteBuffer b;
try(Locker.Lock lock = _locker.lock())
{
<BUG>if (BufferUtil.isEmpty(_out))
_hasOutput.await(time,unit);</BUG>
b=_out;
_out=BufferUtil.allocate(b.capacity());
}

public ByteBuffer waitForOutput(long time,TimeUnit unit) throws InterruptedException
{
ByteBuffer b;
try(Locker.Lock lock = _locker.lock())
{
if (BufferUtil.isEmpty(_out) && !_closed && !_oshut)
_hasOutput.await(time,unit);
b=_out;
_out=BufferUtil.allocate(b.capacity());
}
