本文整理匯總了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);
}