@Override public boolean isDataAvailable(final int timeout) throws IOException { return hasBufferedData(); }
@Override public boolean isDataAvailable(final int timeout) throws IOException { return hasBufferedData(); }
public boolean isDataAvailable(final int timeout) throws IOException { return hasBufferedData(); }
public boolean isDataAvailable(final int timeout) throws IOException { return hasBufferedData(); }
@Override public boolean isDataAvailable(final int timeout) throws IOException { return hasBufferedData(); }
@Override public boolean isDataAvailable(final int timeout) throws IOException { return hasBufferedData(); }
protected boolean awaitInput(final int timeout) throws IOException { if (this.inbuffer.hasBufferedData()) { return true; } fillInputBuffer(timeout); return this.inbuffer.hasBufferedData(); }
protected boolean awaitInput(final int timeout) throws IOException { if (this.inbuffer.hasBufferedData()) { return true; } fillInputBuffer(timeout); return this.inbuffer.hasBufferedData(); }
protected boolean awaitInput(final int timeout) throws IOException { if (this.inbuffer.hasBufferedData()) { return true; } fillInputBuffer(timeout); return this.inbuffer.hasBufferedData(); }
protected boolean awaitInput(final int timeout) throws IOException { if (this.inbuffer.hasBufferedData()) { return true; } fillInputBuffer(timeout); return this.inbuffer.hasBufferedData(); }
protected boolean awaitInput(final int timeout) throws IOException { if (this.inbuffer.hasBufferedData()) { return true; } fillInputBuffer(timeout); return this.inbuffer.hasBufferedData(); }
protected boolean awaitInput(final int timeout) throws IOException { if (this.inbuffer.hasBufferedData()) { return true; } fillInputBuffer(timeout); return this.inbuffer.hasBufferedData(); }
public int read() throws IOException { int noRead; while (!hasBufferedData()) { noRead = fillBuffer(); if (noRead == -1) { return -1; } } return this.buffer[this.bufferpos++] & 0xff; }
public int read() throws IOException { int noRead; while (!hasBufferedData()) { noRead = fillBuffer(); if (noRead == -1) { return -1; } } return this.buffer[this.bufferpos++] & 0xff; }
@Override public int read() throws IOException { int noRead; while (!hasBufferedData()) { noRead = fillBuffer(); if (noRead == -1) { return -1; } } return this.buffer[this.bufferpos++] & 0xff; }
@Override public int read() throws IOException { int noRead; while (!hasBufferedData()) { noRead = fillBuffer(); if (noRead == -1) { return -1; } } return this.buffer[this.bufferpos++] & 0xff; }
@Override public int read() throws IOException { int noRead; while (!hasBufferedData()) { noRead = fillBuffer(); if (noRead == -1) { return -1; } } return this.buffer[this.bufferpos++] & 0xff; }
@Override public int read() throws IOException { int noRead; while (!hasBufferedData()) { noRead = fillBuffer(); if (noRead == -1) { return -1; } } return this.buffer[this.bufferpos++] & 0xff; }
return 0; if (hasBufferedData()) { final int chunk = Math.min(len, this.bufferlen - this.bufferpos); System.arraycopy(this.buffer, this.bufferpos, b, off, chunk); } else { while (!hasBufferedData()) { final int noRead = fillBuffer(); if (noRead == -1) {
private ExpectedResult parseExpectedResponse(Element element, Evaluator evaluator, ResultRecorder resultRecorder) { String contents = getTextAndRemoveIndent(element); contents = replaceVariableReferences(evaluator, contents, resultRecorder); SessionInputBufferImpl buffer = new SessionInputBufferImpl(new HttpTransportMetricsImpl(), contents.length()); buffer.bind(new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8))); DefaultHttpResponseParser defaultHttpResponseParser = new DefaultHttpResponseParser(buffer); ExpectedResult.ExpectedResultBuilder builder = expectedResult(); String body = null; try { HttpResponse httpResponse = defaultHttpResponseParser.parse(); StatusLine statusLine = httpResponse.getStatusLine(); builder.withStatus(statusLine.getStatusCode()); for (Header header : httpResponse.getAllHeaders()) { builder.withHeader(header.getName(), header.getValue()); } if (buffer.hasBufferedData()) { body = ""; while (buffer.hasBufferedData()) { body += (char) buffer.read(); } } builder.withBody(body); } catch (IOException | HttpException e) { e.printStackTrace(); } return builder.build(); }