if (this.buffer.hasData()) { dst.position(position); bytesRead = this.buffer.read(dst);
if (this.buffer.hasData()) { dst.position(position); bytesRead = this.buffer.read(dst);
@Override public int read(final ByteBuffer dst) throws IOException { Args.notNull(dst, "Byte buffer"); if (this.completed) { return -1; } final int bytesRead; if (this.buffer.hasData()) { bytesRead = this.buffer.read(dst); } else { bytesRead = readFromChannel(dst); } if (bytesRead == -1) { this.completed = true; } return bytesRead; }
if (this.buffer.hasData()) { final int maxLen = Math.min(chunk, this.buffer.length()); dst.position(position);
if (this.buffer.hasData()) { final int maxLen = Math.min(chunk, this.buffer.length()); dst.position(position);
@Override public int read(final ByteBuffer dst) throws IOException { Args.notNull(dst, "Byte buffer"); if (this.completed) { return -1; } final int bytesRead; if (this.buffer.hasData()) { bytesRead = this.buffer.read(dst); } else { bytesRead = readFromChannel(dst); } if (bytesRead == -1) { this.completed = true; } return bytesRead; }
if (this.buffer.hasData()) { final int maxLen = Math.min(chunk, this.buffer.length()); bytesRead = this.buffer.read(dst, maxLen);
if (this.buffer.hasData()) { final int maxLen = Math.min(chunk, this.buffer.length()); bytesRead = this.buffer.read(dst, maxLen);
if (this.endOfStream && !this.sessionBuffer.hasData()) { this.state = COMPLETED;
if (this.endOfStream && !this.sessionBuffer.hasData()) { this.state = COMPLETED;