org.apache.http.io.HttpMessageParser Java Examples

The following examples show how to use org.apache.http.io.HttpMessageParser. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TracingManagedHttpClientConnection.java    From caravan with Apache License 2.0 6 votes vote down vote up
private void hackBufferFields(int buffersize, MessageConstraints messageConstraints, CharsetDecoder chardecoder,
        HttpMessageParserFactory<HttpResponse> responseParserFactory) {
    if (!_hackFiledGot)
        return;

    try {
        SessionInputBufferImpl old = (SessionInputBufferImpl) _sessionInputBufferField.get(this);
        _sessionInputBufferImpl = new TracingSessionInputBufferImpl((HttpTransportMetricsImpl) old.getMetrics(), buffersize, -1,
                messageConstraints != null ? messageConstraints : MessageConstraints.DEFAULT, chardecoder, _logFunc);
        _sessionInputBufferField.set(this, _sessionInputBufferImpl);

        HttpMessageParser<HttpResponse> responseParser = (responseParserFactory != null ? responseParserFactory : DefaultHttpResponseParserFactory.INSTANCE)
                .create(getSessionInputBuffer(), messageConstraints);
        _responseParserField.set(this, responseParser);
    } catch (Exception ex) {
        _logger.warn("Hack fields failed.", ex);
    }
}
 
Example #2
Source File: CustomConnectionsHttpClientFactory.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
@Override
protected HttpMessageParser<HttpResponse> createResponseParser(
        final SessionInputBuffer buffer,
        final HttpResponseFactory responseFactory,
        final HttpParams params) {

  return new DefaultHttpResponseParser(
          buffer,
          new MyLineParser(),
          responseFactory,
          params);
}
 
Example #3
Source File: HttpUtils.java    From MediaPlayerProxy with Apache License 2.0 4 votes vote down vote up
@Override
protected HttpMessageParser createResponseParser(final SessionInputBuffer buffer,
		final HttpResponseFactory responseFactory, final HttpParams params) {
	return new DefaultResponseParser(buffer, new IcyLineParser(), responseFactory, params);
}