public boolean isRequestBufferEmpty() { return BufferUtil.isEmpty(_requestBuffer); }
public boolean isRequestBufferEmpty() { return BufferUtil.isEmpty(_requestBuffer); }
private void releaseAggregate() { if (BufferUtil.isEmpty(aggregate)) { bufferPool.release(aggregate); aggregate = null; } }
/** Inflate compressed data from a buffer. * * @param compressed Buffer containing compressed data. * @return Buffer containing inflated data. */ public ByteBuffer decode(ByteBuffer compressed) { decodeChunks(compressed); if (BufferUtil.isEmpty(_inflated) || _state==State.CRC || _state==State.ISIZE ) return BufferUtil.EMPTY_BUFFER; ByteBuffer result = _inflated; _inflated = null; return result; }
/** Inflate compressed data from a buffer. * * @param compressed Buffer containing compressed data. * @return Buffer containing inflated data. */ public ByteBuffer decode(ByteBuffer compressed) { decodeChunks(compressed); if (BufferUtil.isEmpty(_inflated) || _state==State.CRC || _state==State.ISIZE ) return BufferUtil.EMPTY_BUFFER; ByteBuffer result = _inflated; _inflated = null; return result; }
@Override public void send(ByteBuffer content, boolean lastContent, Callback callback) { if (!lastContent && BufferUtil.isEmpty(content)) callback.succeeded(); else if (_sendCallback.reset(null,content,lastContent,callback)) _sendCallback.iterate(); }
if (!BufferUtil.isEmpty(b)) return false;
/** Wait for some output * @param time Time to wait * @param unit Units for time to wait * @return The buffer of output * @throws InterruptedException if interrupted */ public ByteBuffer waitForOutput(long time,TimeUnit unit) throws InterruptedException { ByteBuffer b; try(Locker.Lock lock = _locker.lock()) { while (BufferUtil.isEmpty(_out) && !isOutputShutdown()) { if (!_hasOutput.await(time,unit)) return null; } b=_out; _out=BufferUtil.allocate(b.capacity()); } getWriteFlusher().completeWrite(); return b; }
private Action flush() if (!BufferUtil.isEmpty(aggregate))
/** Wait for some output * @param time Time to wait * @param unit Units for time to wait * @return The buffer of output * @throws InterruptedException if interrupted */ public ByteBuffer waitForOutput(long time,TimeUnit unit) throws InterruptedException { ByteBuffer b; try(Locker.Lock lock = _locker.lock()) { while (BufferUtil.isEmpty(_out) && !isOutputShutdown()) { if (!_hasOutput.await(time,unit)) return null; } b=_out; _out=BufferUtil.allocate(b.capacity()); } getWriteFlusher().completeWrite(); return b; }
if (BufferUtil.isEmpty(in)) _inQ.poll(); break;
@Override public void send(MetaData.Response info, boolean head, ByteBuffer content, boolean lastContent, Callback callback) { if (info == null) { if (!lastContent && BufferUtil.isEmpty(content)) { callback.succeeded(); return; } } else { // If we are still expecting a 100 continues when we commit if (_channel.isExpecting100Continue()) // then we can't be persistent _generator.setPersistent(false); } if(_sendCallback.reset(info,head,content,lastContent,callback)) _sendCallback.iterate(); }
@Override public void send(MetaData.Response info, boolean head, ByteBuffer content, boolean lastContent, Callback callback) { if (info == null) { if (!lastContent && BufferUtil.isEmpty(content)) { callback.succeeded(); return; } } else { // If we are still expecting a 100 continues when we commit if (_channel.isExpecting100Continue()) // then we can't be persistent _generator.setPersistent(false); } if(_sendCallback.reset(info,head,content,lastContent,callback)) { _sendCallback.iterate(); } }
if (BufferUtil.isEmpty(in)) _inQ.poll(); break;
if (BufferUtil.isEmpty(in)) _inQ.poll(); break;
if (!BufferUtil.isEmpty(b)) return false;
if (!BufferUtil.isEmpty(b)) return false;
if (!BufferUtil.isEmpty(b)) return false;
if (BufferUtil.isEmpty(b)) BufferUtil.clear(b); else
if (BufferUtil.isEmpty(requestBuffer) && getEndPoint().isInputShutdown())