java args包_Java Args.positive方法代码示例
import org.apache.http.util.Args; //導(dǎo)入方法依賴的package包/類
/**
* Creates new instance of BHttpConnectionBase.
*
* @param buffersize buffer size. Must be a positive number.
* @param fragmentSizeHint fragment size hint.
* @param chardecoder decoder to be used for decoding HTTP protocol elements.
* If null simple type cast will be used for byte to char conversion.
* @param charencoder encoder to be used for encoding HTTP protocol elements.
* If null simple type cast will be used for char to byte conversion.
* @param constraints Message constraints. If null
* {@link MessageConstraints#DEFAULT} will be used.
* @param incomingContentStrategy incoming content length strategy. If null
* {@link LaxContentLengthStrategyHC4#INSTANCE} will be used.
* @param outgoingContentStrategy outgoing content length strategy. If null
* {@link StrictContentLengthStrategyHC4#INSTANCE} will be used.
*/
protected BHttpConnectionBase(
final int buffersize,
final int fragmentSizeHint,
final CharsetDecoder chardecoder,
final CharsetEncoder charencoder,
final MessageConstraints constraints,
final ContentLengthStrategy incomingContentStrategy,
final ContentLengthStrategy outgoingContentStrategy) {
super();
Args.positive(buffersize, "Buffer size");
final HttpTransportMetricsImpl inTransportMetrics = new HttpTransportMetricsImpl();
final HttpTransportMetricsImpl outTransportMetrics = new HttpTransportMetricsImpl();
this.inbuffer = new SessionInputBufferImpl(inTransportMetrics, buffersize, -1,
constraints != null ? constraints : MessageConstraints.DEFAULT, chardecoder);
this.outbuffer = new SessionOutputBufferImpl(outTransportMetrics, buffersize, fragmentSizeHint,
charencoder);
this.connMetrics = new HttpConnectionMetricsImpl(inTransportMetrics, outTransportMetrics);
this.incomingContentStrategy = incomingContentStrategy != null ? incomingContentStrategy :
LaxContentLengthStrategyHC4.INSTANCE;
this.outgoingContentStrategy = outgoingContentStrategy != null ? outgoingContentStrategy :
StrictContentLengthStrategyHC4.INSTANCE;
}
總結(jié)
以上是生活随笔為你收集整理的java args包_Java Args.positive方法代码示例的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java mission 篡改后 网速很
- 下一篇: JAVA工作总是维护项目_开发维护大型