Java 类org.apache.http.impl.entity.StrictContentLengthStrategy 实例源码

项目:purecloud-iot    文件:ManagedHttpClientConnectionFactory.java   
/**
 * @since 4.4
 */
public ManagedHttpClientConnectionFactory(
        final HttpMessageWriterFactory<HttpRequest> requestWriterFactory,
        final HttpMessageParserFactory<HttpResponse> responseParserFactory,
        final ContentLengthStrategy incomingContentStrategy,
        final ContentLengthStrategy outgoingContentStrategy) {
    super();
    this.requestWriterFactory = requestWriterFactory != null ? requestWriterFactory :
            DefaultHttpRequestWriterFactory.INSTANCE;
    this.responseParserFactory = responseParserFactory != null ? responseParserFactory :
            DefaultHttpResponseParserFactory.INSTANCE;
    this.incomingContentStrategy = incomingContentStrategy != null ? incomingContentStrategy :
            LaxContentLengthStrategy.INSTANCE;
    this.outgoingContentStrategy = outgoingContentStrategy != null ? outgoingContentStrategy :
            StrictContentLengthStrategy.INSTANCE;
}
项目:wso2-axis2    文件:AxisHttpConnectionImpl.java   
public AxisHttpConnectionImpl(final Socket socket, final HttpParams params) 
        throws IOException {
    super();
    if (socket == null) {
        throw new IllegalArgumentException("Socket may not be null"); 
    }
    if (params == null) {
        throw new IllegalArgumentException("HTTP parameters may not be null"); 
    }
    socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
    socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));

    int linger = HttpConnectionParams.getLinger(params);
    if (linger >= 0) {
        socket.setSoLinger(linger > 0, linger);
    }

    int buffersize = HttpConnectionParams.getSocketBufferSize(params);
    this.socket = socket;
    this.outbuffer = new SocketOutputBuffer(socket, buffersize, params); 
    this.inbuffer = new SocketInputBuffer(socket, buffersize, params); 
    this.contentLenStrategy = new StrictContentLengthStrategy();
    this.requestParser = new HttpRequestParser(
            this.inbuffer, null, new DefaultHttpRequestFactory(), params);
    this.responseWriter = new HttpResponseWriter(
            this.outbuffer, null, params);
}
项目:lams    文件:AbstractHttpClientConnection.java   
/**
 * Creates an instance of {@link EntitySerializer} with the
 * {@link StrictContentLengthStrategy} implementation to be used for
 * serializing HTTP entities sent over this connection.
 * <p>
 * This method can be overridden in a super class in order to create
 * instances of {@link EntitySerializer} using a custom
 * {@link ContentLengthStrategy}.
 *
 * @return HTTP entity serialzier.
 */
protected EntitySerializer createEntitySerializer() {
    return new EntitySerializer(new StrictContentLengthStrategy());
}
项目:lams    文件:AbstractHttpServerConnection.java   
/**
 * Creates an instance of {@link EntitySerializer} with the
 * {@link StrictContentLengthStrategy} implementation to be used for
 * serializing HTTP entities sent over this connection.
 * <p>
 * This method can be overridden in a super class in order to create
 * instances of {@link EntitySerializer} using a custom
 * {@link ContentLengthStrategy}.
 *
 * @return HTTP entity serialzier.
 */
protected EntitySerializer createEntitySerializer() {
    return new EntitySerializer(new StrictContentLengthStrategy());
}