亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? httpmethodbase.java

?? Light in the box 抓取程序。 使用HttpClient
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
     * If the response is large this method involves lots of array copying and many object      * allocations, which makes it unsuitable for high-performance / low-footprint applications.     * Those applications should use {@link #getResponseBodyAsStream()}.     *      * @param maxlen the maximum content length to accept (number of bytes).      * @return The response body.     *      * @throws IOException If an I/O (transport) problem occurs while obtaining the      * response body.     */    public byte[] getResponseBody(int maxlen) throws IOException {        if (maxlen < 0) throw new IllegalArgumentException("maxlen must be positive");        if (this.responseBody == null) {            InputStream instream = getResponseBodyAsStream();            if (instream != null) {                // we might already know that the content is larger                long contentLength = getResponseContentLength();                if ((contentLength != -1) && (contentLength > maxlen)) {                    throw new HttpContentTooLargeException(                            "Content-Length is " + contentLength, maxlen);                }                                LOG.debug("Buffering response body");                ByteArrayOutputStream rawdata = new ByteArrayOutputStream(                        contentLength > 0 ? (int) contentLength : DEFAULT_INITIAL_BUFFER_SIZE);                byte[] buffer = new byte[2048];                int pos = 0;                int len;                do {                    len = instream.read(buffer, 0, Math.min(buffer.length, maxlen-pos));                    if (len == -1) break;                    rawdata.write(buffer, 0, len);                    pos += len;                } while (pos < maxlen);                                setResponseStream(null);                // check if there is even more data                if (pos == maxlen) {                    if (instream.read() != -1)                        throw new HttpContentTooLargeException(                                "Content-Length not known but larger than "                                + maxlen, maxlen);                }                this.responseBody = rawdata.toByteArray();            }        }        return this.responseBody;    }    /**     * Returns the response body of the HTTP method, if any, as an {@link InputStream}.      * If response body is not available, returns <tt>null</tt>. If the response has been     * buffered this method returns a new stream object on every call. If the response     * has not been buffered the returned stream can only be read once.     *      * @return The response body or <code>null</code>.     *      * @throws IOException If an I/O (transport) problem occurs while obtaining the      * response body.     */    public InputStream getResponseBodyAsStream() throws IOException {        if (responseStream != null) {            return responseStream;        }        if (responseBody != null) {            InputStream byteResponseStream = new ByteArrayInputStream(responseBody);            LOG.debug("re-creating response stream from byte array");            return byteResponseStream;        }        return null;    }    /**     * Returns the response body of the HTTP method, if any, as a {@link String}.      * If response body is not available or cannot be read, returns <tt>null</tt>     * The string conversion on the data is done using the character encoding specified     * in <tt>Content-Type</tt> header. Buffers the response and this method can be      * called several times yielding the same result each time.     *      * Note: This will cause the entire response body to be buffered in memory. A     * malicious server may easily exhaust all the VM memory. It is strongly     * recommended, to use getResponseAsStream if the content length of the response     * is unknown or resonably large.     *      * @return The response body or <code>null</code>.     *      * @throws IOException If an I/O (transport) problem occurs while obtaining the      * response body.     */    public String getResponseBodyAsString() throws IOException {        byte[] rawdata = null;        if (responseAvailable()) {            rawdata = getResponseBody();        }        if (rawdata != null) {            return EncodingUtil.getString(rawdata, getResponseCharSet());        } else {            return null;        }    }        /**     * Returns the response body of the HTTP method, if any, as a {@link String}.      * If response body is not available or cannot be read, returns <tt>null</tt>     * The string conversion on the data is done using the character encoding specified     * in <tt>Content-Type</tt> header. Buffers the response and this method can be      * called several times yielding the same result each time.</p>     *      * Note: This will cause the entire response body to be buffered in memory. This method is     * safe if the content length of the response is unknown, because the amount of memory used     * is limited.<p>     *      * If the response is large this method involves lots of array copying and many object      * allocations, which makes it unsuitable for high-performance / low-footprint applications.     * Those applications should use {@link #getResponseBodyAsStream()}.     *      * @param maxlen the maximum content length to accept (number of bytes). Note that,     * depending on the encoding, this is not equal to the number of characters.     * @return The response body or <code>null</code>.     *      * @throws IOException If an I/O (transport) problem occurs while obtaining the      * response body.     */    public String getResponseBodyAsString(int maxlen) throws IOException {        if (maxlen < 0) throw new IllegalArgumentException("maxlen must be positive");        byte[] rawdata = null;        if (responseAvailable()) {            rawdata = getResponseBody(maxlen);        }        if (rawdata != null) {            return EncodingUtil.getString(rawdata, getResponseCharSet());        } else {            return null;        }    }    /**     * Returns an array of the response footers that the HTTP method currently has     * in the order in which they were read.     *     * @return an array of footers     */    public Header[] getResponseFooters() {        return getResponseTrailerHeaderGroup().getAllHeaders();    }    /**     * Gets the response footer associated with the given name.     * Footer name matching is case insensitive.     * <tt>null</tt> will be returned if either <i>footerName</i> is     * <tt>null</tt> or there is no matching footer for <i>footerName</i>     * or there are no footers available.  If there are multiple footers     * with the same name, there values will be combined with the ',' separator     * as specified by RFC2616.     *      * @param footerName the footer name to match     * @return the matching footer     */    public Header getResponseFooter(String footerName) {        if (footerName == null) {            return null;        } else {            return getResponseTrailerHeaderGroup().getCondensedHeader(footerName);        }    }    /**     * Sets the response stream.     * @param responseStream The new response stream.     */    protected void setResponseStream(InputStream responseStream) {        this.responseStream = responseStream;    }    /**     * Returns a stream from which the body of the current response may be read.     * If the method has not yet been executed, if <code>responseBodyConsumed</code>     * has been called, or if the stream returned by a previous call has been closed,     * <code>null</code> will be returned.     *     * @return the current response stream     */    protected InputStream getResponseStream() {        return responseStream;    }        /**     * Returns the status text (or "reason phrase") associated with the latest     * response.     *      * @return The status text.     */    public String getStatusText() {        return statusLine.getReasonPhrase();    }    /**     * Defines how strictly HttpClient follows the HTTP protocol specification       * (RFC 2616 and other relevant RFCs). In the strict mode HttpClient precisely     * implements the requirements of the specification, whereas in non-strict mode      * it attempts to mimic the exact behaviour of commonly used HTTP agents,      * which many HTTP servers expect.     *      * @param strictMode <tt>true</tt> for strict mode, <tt>false</tt> otherwise     *      * @deprecated Use {@link org.apache.commons.httpclient.params.HttpParams#setParameter(String, Object)}     * to exercise a more granular control over HTTP protocol strictness.     */    public void setStrictMode(boolean strictMode) {        if (strictMode) {            this.params.makeStrict();        } else {            this.params.makeLenient();        }    }    /**     * @deprecated Use {@link org.apache.commons.httpclient.params.HttpParams#setParameter(String, Object)}     * to exercise a more granular control over HTTP protocol strictness.     *     * @return <tt>false</tt>     */    public boolean isStrictMode() {        return false;    }    /**     * Adds the specified request header, NOT overwriting any previous value.     * Note that header-name matching is case insensitive.     *     * @param headerName the header's name     * @param headerValue the header's value     */    public void addRequestHeader(String headerName, String headerValue) {        addRequestHeader(new Header(headerName, headerValue));    }    /**     * Tests if the connection should be force-closed when no longer needed.     *      * @return <code>true</code> if the connection must be closed     */    protected boolean isConnectionCloseForced() {        return this.connectionCloseForced;    }    /**     * Sets whether or not the connection should be force-closed when no longer      * needed. This value should only be set to <code>true</code> in abnormal      * circumstances, such as HTTP protocol violations.      *      * @param b <code>true</code> if the connection must be closed, <code>false</code>     * otherwise.     */    protected void setConnectionCloseForced(boolean b) {        if (LOG.isDebugEnabled()) {            LOG.debug("Force-close connection: " + b);        }        this.connectionCloseForced = b;    }    /**     * Tests if the connection should be closed after the method has been executed.     * The connection will be left open when using HTTP/1.1 or if <tt>Connection:      * keep-alive</tt> header was sent.     *      * @param conn the connection in question     *      * @return boolean true if we should close the connection.     */    protected boolean shouldCloseConnection(HttpConnection conn) {        // Connection must be closed due to an abnormal circumstance         if (isConnectionCloseForced()) {            LOG.debug("Should force-close connection.");            return true;        }        Header connectionHeader = null;        // In case being connected via a proxy server        if (!conn.isTransparent()) {            // Check for 'proxy-connection' directive            connectionHeader = responseHeaders.getFirstHeader("proxy-connection");        }        // In all cases Check for 'connection' directive        // some non-complaint proxy servers send it instread of        // expected 'proxy-connection' directive        if (connectionHeader == null) {            connectionHeader = responseHeaders.getFirstHeader("connection");        }        // In case the response does not contain any explict connection        // directives, check whether the request does        if (connectionHeader == null) {            connectionHeader = requestHeaders.getFirstHeader("connection");        }        if (connectionHeader != null) {            if (connectionHeader.getValue().equalsIgnoreCase("close")) {                if (LOG.isDebugEnabled()) {                    LOG.debug("Should close connection in response to directive: "                         + connectionHeader.getValue());                }                return true;            } else if (connectionHeader.getValue().equalsIgnoreCase("keep-alive")) {                if (LOG.isDebugEnabled()) {                    LOG.debug("Should NOT close connection in response to directive: "                         + connectionHeader.getValue());                }                return false;            } else {                if (LOG.isDebugEnabled()) {                    LOG.debug("Unknown directive: " + connectionHeader.toExternalForm());                }            }        }        LOG.debug("Resorting to protocol version default close connection policy");        // missing or invalid connection header, do the default        if (this.effectiveVersion.greaterEquals(HttpVersion.HTTP_1_1)) {            if (LOG.isDebugEnabled()) {                LOG.debug("Should NOT close connection, using " + this.effectiveVersion.toString());            }        } else {            if (LOG.isDebugEnabled()) {                LOG.debug("Should close connection, using " + this.effectiveVersion.toString());            }        }        return this.effectiveVersion.lessEquals(HttpVersion.HTTP_1_0);    }        /**     * Tests if the this method is ready to be executed.     *      * @param state the {@link HttpState state} information associated with this method     * @param conn the {@link HttpConnection connection} to be used     * @throws HttpException If the method is in invalid state.     */    private void checkExecuteConditions(HttpState state, HttpConnection conn)    throws HttpException {        if (state == null) {            throw new IllegalArgumentException("HttpState parameter may not be null");        }        if (conn == null) {            throw new IllegalArgumentException("HttpConnection parameter may not be null");        }        if (this.aborted) {            throw new IllegalStateException("Method has been aborted");        }        if (!validate()) {            throw new ProtocolException("HttpMethodBase object not valid");        }    }    /**     * Executes this method using the specified <code>HttpConnection</code> and     * <code>HttpState</code>.      *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久久久久免费看 | 日韩一区二区三免费高清| 欧美大片在线观看| 亚洲男人的天堂av| 狠狠色丁香久久婷婷综| 欧美日韩亚洲另类| 亚洲人成网站色在线观看| 国模娜娜一区二区三区| 欧美精品vⅰdeose4hd| 亚洲欧洲精品天堂一级| 国产一区二区不卡老阿姨| 91精品麻豆日日躁夜夜躁| 有码一区二区三区| 99久久精品情趣| 国产精品久久免费看| 国产精品一二三四五| 欧美变态tickling挠脚心| 日韩精品一区第一页| 欧美综合一区二区三区| 亚洲天堂网中文字| 成人av资源站| 国产欧美日韩视频一区二区| 久久精品国产精品亚洲综合| 欧美日韩精品是欧美日韩精品| 自拍视频在线观看一区二区| 国产成人亚洲综合色影视| 欧美精品一区二区久久久| 毛片av一区二区| 91麻豆精品国产自产在线| 亚洲高清视频在线| 在线免费精品视频| 亚洲国产综合在线| 欧美精品一卡二卡| 日韩电影在线一区二区三区| 69堂国产成人免费视频| 麻豆久久一区二区| 欧美成人三级电影在线| 国产乱色国产精品免费视频| 2017欧美狠狠色| 岛国一区二区在线观看| 亚洲欧美在线视频观看| 欧美中文字幕一区| 麻豆精品视频在线观看视频| 欧美成人video| 成人午夜精品一区二区三区| 最新中文字幕一区二区三区| 日本精品一区二区三区高清| 亚洲国产精品一区二区www在线| 欧美日本一道本在线视频| 日本在线观看不卡视频| 久久女同精品一区二区| 国产91精品免费| 尤物av一区二区| 欧美精品久久久久久久多人混战| 日本成人在线视频网站| 26uuu国产电影一区二区| 成人精品一区二区三区四区 | 久久只精品国产| 成人激情免费电影网址| 亚洲最新在线观看| 欧美mv日韩mv国产网站app| 国产suv一区二区三区88区| 一级精品视频在线观看宜春院| 欧美日韩aaaaa| 国产成人av自拍| 一区二区三区成人| 26uuu久久天堂性欧美| 97精品国产97久久久久久久久久久久| 亚洲一区二区三区中文字幕在线| 欧美一级片在线看| 91在线观看污| 青青草成人在线观看| 亚洲欧洲另类国产综合| 91麻豆精品久久久久蜜臀| av综合在线播放| 看片网站欧美日韩| 亚洲欧美日韩国产综合| 精品国产青草久久久久福利| 色综合中文综合网| 亚洲国产精品精华液ab| 欧美日韩mp4| 99国产精品久久久| 久久成人免费电影| 亚洲国产精品久久久男人的天堂| 久久这里只精品最新地址| 欧美日韩精品欧美日韩精品一综合| 国产精品99久久久久久有的能看 | 亚洲欧美一区二区三区极速播放| 欧美成人一级视频| 欧美丝袜丝交足nylons图片| 懂色av中文一区二区三区| 免费人成在线不卡| 亚洲超丰满肉感bbw| 国产精品高潮呻吟| 国产欧美日本一区视频| 精品国产乱码久久久久久蜜臀 | 亚洲国产精品综合小说图片区| 国产视频视频一区| 日韩亚洲欧美一区| 欧美日韩国产一区二区三区地区| 91视频国产观看| 国产99一区视频免费 | 欧美a级理论片| 亚洲v日本v欧美v久久精品| 国产精品免费视频一区| 欧美激情一区二区三区不卡| 精品久久久久一区二区国产| 欧美一区二区三区在线看| 欧美日韩国产综合久久| 欧美日韩国产首页在线观看| 色吧成人激情小说| 91浏览器入口在线观看| eeuss影院一区二区三区| gogo大胆日本视频一区| 99久久精品免费看| 色8久久人人97超碰香蕉987| 色婷婷综合视频在线观看| 色婷婷av久久久久久久| 在线观看国产精品网站| 欧美日韩国产综合久久| 在线播放欧美女士性生活| 欧美一区二区三区视频在线 | 国产欧美日韩在线观看| 中文字幕高清不卡| 国产精品高潮久久久久无| 亚洲丝袜另类动漫二区| 一区二区三区精品在线| 天堂蜜桃91精品| 奇米影视7777精品一区二区| 韩国在线一区二区| 粉嫩av一区二区三区粉嫩 | 国产激情视频一区二区在线观看| 国产麻豆日韩欧美久久| jlzzjlzz亚洲日本少妇| 欧美系列在线观看| 欧美一区二区三区四区在线观看| 久久亚洲精精品中文字幕早川悠里| 久久久亚洲精品一区二区三区| 欧美国产亚洲另类动漫| 亚洲影院理伦片| 经典三级一区二区| 国产91精品免费| 欧美日韩一区二区三区四区五区| 日韩欧美资源站| 亚洲欧洲精品成人久久奇米网| 亚洲一卡二卡三卡四卡无卡久久| 天天色综合成人网| 国产成人综合在线观看| 色婷婷激情综合| 欧美va在线播放| 亚洲免费观看在线观看| 蜜臀av一区二区在线免费观看| 国产99久久久精品| 欧美区视频在线观看| 久久久久99精品一区| 亚洲主播在线播放| 国产精品一区二区视频| 精品视频在线看| 欧美激情资源网| 蜜桃久久精品一区二区| 色婷婷久久久久swag精品| 久久免费电影网| 日本网站在线观看一区二区三区| 不卡影院免费观看| 日韩精品中文字幕一区| 亚洲激情网站免费观看| 激情综合亚洲精品| 欧美视频一区在线观看| 国产精品日日摸夜夜摸av| 日本vs亚洲vs韩国一区三区 | 国产精品一区二区在线播放| 欧美性一级生活| 亚洲欧美综合色| 风流少妇一区二区| 精品国产欧美一区二区| 日韩黄色小视频| 色老头久久综合| 亚洲色图欧美偷拍| 成人免费看的视频| 国产欧美精品一区二区色综合 | 久久成人精品无人区| 欧美三级资源在线| 亚洲激情图片qvod| 91色porny在线视频| 国产精品网站在线| 高清久久久久久| 精品国产污污免费网站入口| 香蕉乱码成人久久天堂爱免费| 91亚洲资源网| 成人免费在线播放视频| 国产99久久久精品| 国产无一区二区| 国产成人99久久亚洲综合精品| 欧美精品一区二区三区蜜桃| 精品午夜一区二区三区在线观看| 欧美一区二区二区| 精品亚洲porn| 国产日韩精品一区二区三区 | jvid福利写真一区二区三区| 国产免费久久精品|