當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpParams.getIntParameter方法代碼示例

本文整理匯總了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);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:32,代碼來源:AbstractSessionInputBuffer.java

示例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);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:28,代碼來源:AbstractSessionOutputBuffer.java

示例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;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:28,代碼來源:AbstractMessageParser.java

示例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;
    }
}
 
開發者ID:Hitachi-Data-Systems,項目名稱:Open-DM,代碼行數:15,代碼來源:HCAPAdapter.java

示例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);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:16,代碼來源:ConnManagerParams.java

示例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);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:6,代碼來源:DefaultResponseParser.java


注:本文中的org.apache.http.params.HttpParams.getIntParameter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。