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