本文整理汇总了Java中org.apache.http.params.HttpParams.getIntParameter方法的典型用法代码示例。如果您正苦于以下问题:Java HttpParams.getIntParameter方法的具体用法?Java HttpParams.getIntParameter怎么用?Java HttpParams.getIntParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.http.params.HttpParams
的用法示例。
在下文中一共展示了HttpParams.getIntParameter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.apache.http.params.HttpParams; //导入方法依赖的package包/类
/**
* Initializes this session input buffer.
*
* @param instream the source input stream.
* @param buffersize the size of the internal buffer.
* @param params HTTP parameters.
*/
protected void init(final InputStream instream, int buffersize, final HttpParams params) {
if (instream == null) {
throw new IllegalArgumentException("Input stream may not be null");
}
if (buffersize <= 0) {
throw new IllegalArgumentException("Buffer size may not be negative or zero");
}
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
this.instream = instream;
this.buffer = new byte[buffersize];
this.bufferpos = 0;
this.bufferlen = 0;
this.linebuffer = new ByteArrayBuffer(buffersize);
this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
this.ascii = this.charset.equals(ASCII);
this.decoder = null;
this.maxLineLen = params.getIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, -1);
this.minChunkLimit = params.getIntParameter(CoreConnectionPNames.MIN_CHUNK_LIMIT, 512);
this.metrics = createTransportMetrics();
this.onMalformedInputAction = HttpProtocolParams.getMalformedInputAction(params);
this.onUnMappableInputAction = HttpProtocolParams.getUnmappableInputAction(params);
}
示例2: init
import org.apache.http.params.HttpParams; //导入方法依赖的package包/类
/**
* Initializes this session output buffer.
*
* @param outstream the destination output stream.
* @param buffersize the size of the internal buffer.
* @param params HTTP parameters.
*/
protected void init(final OutputStream outstream, int buffersize, final HttpParams params) {
if (outstream == null) {
throw new IllegalArgumentException("Input stream may not be null");
}
if (buffersize <= 0) {
throw new IllegalArgumentException("Buffer size may not be negative or zero");
}
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
this.outstream = outstream;
this.buffer = new ByteArrayBuffer(buffersize);
this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
this.ascii = this.charset.equals(ASCII);
this.encoder = null;
this.minChunkLimit = params.getIntParameter(CoreConnectionPNames.MIN_CHUNK_LIMIT, 512);
this.metrics = createTransportMetrics();
this.onMalformedInputAction = HttpProtocolParams.getMalformedInputAction(params);
this.onUnMappableInputAction = HttpProtocolParams.getUnmappableInputAction(params);
}
示例3: AbstractMessageParser
import org.apache.http.params.HttpParams; //导入方法依赖的package包/类
/**
* Creates an instance of this class.
*
* @param buffer the session input buffer.
* @param parser the line parser.
* @param params HTTP parameters.
*/
public AbstractMessageParser(
final SessionInputBuffer buffer,
final LineParser parser,
final HttpParams params) {
super();
if (buffer == null) {
throw new IllegalArgumentException("Session input buffer may not be null");
}
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
this.sessionBuffer = buffer;
this.maxHeaderCount = params.getIntParameter(
CoreConnectionPNames.MAX_HEADER_COUNT, -1);
this.maxLineLen = params.getIntParameter(
CoreConnectionPNames.MAX_LINE_LENGTH, -1);
this.lineParser = (parser != null) ? parser : BasicLineParser.DEFAULT;
this.headerLines = new ArrayList<CharArrayBuffer>();
this.state = HEAD_LINE;
}
示例4: getIntClientParameter
import org.apache.http.params.HttpParams; //导入方法依赖的package包/类
/**
* Retrieves the current connection timeout, null if not set or if set to Integer.MIN_VALUE
*
* @return The current timeout
*/
protected Integer getIntClientParameter(final String parameter) {
HttpParams params = httpClient.getParams();
int value = params.getIntParameter(parameter, Integer.MIN_VALUE);
if (value != Integer.MIN_VALUE) {
return value;
} else {
return null;
}
}
示例5: getMaxTotalConnections
import org.apache.http.params.HttpParams; //导入方法依赖的package包/类
/**
* Gets the maximum number of connections allowed.
*
* @param params HTTP parameters
*
* @return The maximum number of connections allowed.
*/
public static int getMaxTotalConnections(
final HttpParams params) {
if (params == null) {
throw new IllegalArgumentException
("HTTP parameters must not be null.");
}
return params.getIntParameter(MAX_TOTAL_CONNECTIONS, DEFAULT_MAX_TOTAL_CONNECTIONS);
}
示例6: getMaxGarbageLines
import org.apache.http.params.HttpParams; //导入方法依赖的package包/类
protected int getMaxGarbageLines(final HttpParams params) {
return params.getIntParameter(
org.apache.http.conn.params.ConnConnectionPNames.MAX_STATUS_LINE_GARBAGE,
Integer.MAX_VALUE);
}