if (entity != null) sharedStream = new SharedInputStream(new SharedInputBuffer(16 * 1024));
@Override public void reset() { if (this.shutdown) { return; } this.lock.lock(); try { clear(); this.endOfStream = false; } finally { this.lock.unlock(); } }
/** * @deprecated (4.3) use {@link #consumeContent(ContentDecoder, IOControl)} */ @Override @Deprecated public int consumeContent(final ContentDecoder decoder) throws IOException { return consumeContent(decoder, null); }
@Override public int read() throws IOException { if (this.shutdown) { return -1; } this.lock.lock(); try { if (!hasData()) { waitForData(); } if (isEndOfStream()) { return -1; } return this.buffer.get() & 0xff; } finally { this.lock.unlock(); } }
@Override public int read(final byte[] b, final int off, final int len) throws IOException { if (this.shutdown) { return -1; } if (b == null) { return 0; } this.lock.lock(); try { if (!hasData()) { waitForData(); } if (isEndOfStream()) { return -1; } setOutputMode(); int chunk = len; if (chunk > this.buffer.remaining()) { chunk = this.buffer.remaining(); } this.buffer.get(b, off, chunk); return chunk; } finally { this.lock.unlock(); } }
public int read(final byte[] b) throws IOException { if (this.shutdown) { return -1; } if (b == null) { return 0; } return read(b, 0, b.length); }
protected boolean isEndOfStream() { return this.shutdown || (!hasData() && this.endOfStream); }
this.ioctrl = ioctrl; setInputMode(); int totalRead = 0; int bytesRead;
@Override public int read(final byte[] b, final int off, final int len) throws IOException { if (this.shutdown) { return -1; } if (b == null) { return 0; } this.lock.lock(); try { if (!hasData()) { waitForData(); } if (isEndOfStream()) { return -1; } setOutputMode(); int chunk = len; if (chunk > this.buffer.remaining()) { chunk = this.buffer.remaining(); } this.buffer.get(b, off, chunk); return chunk; } finally { this.lock.unlock(); } }
@Override public int read() throws IOException { if (this.shutdown) { return -1; } this.lock.lock(); try { if (!hasData()) { waitForData(); } if (isEndOfStream()) { return -1; } return this.buffer.get() & 0xff; } finally { this.lock.unlock(); } }
public int read(final byte[] b) throws IOException { if (this.shutdown) { return -1; } if (b == null) { return 0; } return read(b, 0, b.length); }
protected boolean isEndOfStream() { return this.shutdown || (!hasData() && this.endOfStream); }
this.ioctrl = ioctrl; setInputMode(); int totalRead = 0; int bytesRead;
if (entity != null) sharedStream = new SharedInputStream(new SharedInputBuffer(16 * 1024));
/** * @deprecated (4.3) use {@link #consumeContent(ContentDecoder, IOControl)} */ @Override @Deprecated public int consumeContent(final ContentDecoder decoder) throws IOException { return consumeContent(decoder, null); }
@Override public void reset() { if (this.shutdown) { return; } this.lock.lock(); try { clear(); this.endOfStream = false; } finally { this.lock.unlock(); } }
if (entity != null) sharedStream = new SharedInputStream(new SharedInputBuffer(16 * 1024));
= new SharedInputBuffer(cfg.getBufferSize(), conn, allocator); context.setAttribute(RESPONSE_SINK_BUFFER, inputBuffer);
ContentInputBuffer inputBuffer = new SharedInputBuffer(8, conn, allocator); context.setAttribute(RESPONSE_SINK_BUFFER, inputBuffer);
= new SharedInputBuffer(cfg.getBufferSize(), conn, allocator); context.setAttribute(REQUEST_SINK_BUFFER, inputBuffer); is = new ContentInputStream(inputBuffer);