public boolean isBufferEmpty() { _lock.lock(); try { return _buffer == null || _buffer.length() == 0; } finally { _lock.unlock(); } }
public boolean isBufferEmpty() { _lock.lock(); try { return _buffer == null || _buffer.length() == 0; } finally { _lock.unlock(); } }
public boolean isBufferEmpty() { _lock.lock(); try { return _buffer == null || _buffer.length() == 0; } finally { _lock.unlock(); } }
@Override // TODO simone says shouldn't be needed public void content(Buffer ref) throws IOException { if (_error == null) _error = "Bad response. " + ref.length() + "B of content?"; _endp.close(); } });
public void parsedRemoteAddr(Buffer addr) throws IOException { if (addr != null && addr.length()>0) { _request.setRemoteAddr(addr.toString()); } }
@Override // TODO simone says shouldn't be needed public void content(Buffer ref) throws IOException { if (_error == null) _error = "Bad response. " + ref.length() + "B of content?"; _endp.close(); } });
public void returnBuffer() { if (_buffer!=null && _buffer.length()==0) { _buffers.returnBuffer(_buffer); _buffer=null; } }
@Override protected void onResponseContent(Buffer content) throws IOException { if (debug != 0) _log.debug(debug + " content" + content.length()); content.writeTo(out); }
public void fill(Buffer buffer) { if (buffer!=null && buffer.length()>0) { if (_buffer==null) _buffer=_buffers.getBuffer(); _buffer.put(buffer); buffer.clear(); } }
public void fill(Buffer buffer) { if (buffer!=null && buffer.length()>0) { if (_buffer==null) _buffer=_buffers.getBuffer(); _buffer.put(buffer); buffer.clear(); } }
public InputStream getInputStream() throws IOException { Buffer indirect = getIndirectBuffer(); if (indirect!=null && indirect.array()!=null) return new ByteArrayInputStream(indirect.array(),indirect.getIndex(),indirect.length()); return _resource.getInputStream(); }
public InputStream getInputStream() throws IOException { Buffer indirect = getIndirectBuffer(); if (indirect!=null && indirect.array()!=null) return new ByteArrayInputStream(indirect.array(),indirect.getIndex(),indirect.length()); return _resource.getInputStream(); }
private void addBuffer(Buffer b) { if (b == null) { addInt(0xFFFF); return; } addInt(b.length()); _buffer.put(b); _buffer.put((byte)0); }