@Override public boolean isBufferFull() { // Should we flush the buffers? return super.isBufferFull() || _bufferChunked || _bypass || (_contentLength == HttpTokens.CHUNKED_CONTENT && _buffer != null && _buffer.space() < CHUNK_SPACE); }
@Override public boolean isBufferFull() { // Should we flush the buffers? return super.isBufferFull() || _bufferChunked || _bypass || (_contentLength == HttpTokens.CHUNKED_CONTENT && _buffer != null && _buffer.space() < CHUNK_SPACE); }
@Override public int prepareUncheckedAddContent() throws IOException { initBuffer(); return _buffer.space(); }
@Override public boolean isBufferFull() { // Should we flush the buffers? return super.isBufferFull() || _bufferChunked || _bypass || (_contentLength == HttpTokens.CHUNKED_CONTENT && _buffer != null && _buffer.space() < CHUNK_SPACE); }
@Override public boolean isBufferFull() { // Should we flush the buffers? return super.isBufferFull() || _bufferChunked || _bypass || (_contentLength == HttpTokens.CHUNKED_CONTENT && _buffer != null && _buffer.space() < CHUNK_SPACE); }
@Override public boolean isBufferFull() { // Should we flush the buffers? return super.isBufferFull() || _bufferChunked || _bypass || (_contentLength == HttpTokens.CHUNKED_CONTENT && _buffer != null && _buffer.space() < CHUNK_SPACE); }
private synchronized void bufferPut(byte datum, long blockFor) throws IOException { if (_buffer==null) _buffer=_buffers.getDirectBuffer(); _buffer.put(datum); if (_buffer.space() == 0) expelBuffer(blockFor); }
private synchronized void bufferPut(byte datum, long blockFor) throws IOException { if (_buffer==null) _buffer=_buffers.getDirectBuffer(); _buffer.put(datum); if (_buffer.space() == 0) expelBuffer(blockFor); }
private synchronized void bufferPut(byte datum, long blockFor) throws IOException { if (_buffer==null) _buffer=_buffers.getDirectBuffer(); _buffer.put(datum); if (_buffer.space() == 0) expelBuffer(blockFor); }
public Buffer getRequestContentChunk(Buffer buffer) throws IOException { synchronized (this) { if (_requestContentSource!=null) { if (buffer == null) buffer = new ByteArrayBuffer(8192); // TODO configure int space = buffer.space(); int length = _requestContentSource.read(buffer.array(),buffer.putIndex(),space); if (length >= 0) { buffer.setPutIndex(buffer.putIndex()+length); return buffer; } } return null; } }
private synchronized int expelBuffer(long blockFor) throws IOException { if (_buffer==null) return 0; int result = flushBuffer(); _buffer.compact(); if (!_endp.isBlocking()) { while (_buffer.space()==0) { boolean ready = _endp.blockWritable(blockFor); if (!ready) throw new IOException("Write timeout"); result += flushBuffer(); _buffer.compact(); } } return result; }
private synchronized int expelBuffer(long blockFor) throws IOException { if (_buffer==null) return 0; int result = flushBuffer(); _buffer.compact(); if (!_endp.isBlocking()) { while (_buffer.space()==0) { boolean ready = _endp.blockWritable(blockFor); if (!ready) throw new IOException("Write timeout"); result += flushBuffer(); _buffer.compact(); } } return result; }
private synchronized int expelBuffer(long blockFor) throws IOException { if (_buffer==null) return 0; int result = flushBuffer(); _buffer.compact(); if (!_endp.isBlocking()) { while (_buffer.space()==0) { boolean ready = _endp.blockWritable(blockFor); if (!ready) throw new IOException("Write timeout"); result += flushBuffer(); _buffer.compact(); } } return result; }
private synchronized int expelBuffer(long blockFor) throws IOException { if (_buffer==null) return 0; int result = flushBuffer(); _buffer.compact(); if (!_endp.isBlocking()) { while (_buffer.space()==0) { boolean ready = _endp.blockWritable(blockFor); if (!ready) throw new IOException("Write timeout"); result += flushBuffer(); _buffer.compact(); } } return result; }
private synchronized int expelBuffer(long blockFor) throws IOException { if (_buffer==null) return 0; int result = flushBuffer(); _buffer.compact(); if (!_endp.isBlocking()) { while (_buffer.space()==0) { boolean ready = _endp.blockWritable(blockFor); if (!ready) throw new IOException("Write timeout"); result += flushBuffer(); _buffer.compact(); } } return result; }