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

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

?? httpparser.java

?? 一個基于lucene&heritrix的搜索引擎
?? JAVA
字號:
/* * $Header: /cvsroot/archive-crawler/ArchiveOpenCrawler/src/java/org/apache/commons/httpclient/HttpParser.java,v 1.4 2005/08/08 19:38:22 gojomo Exp $ * $Revision: 1.4 $ * $Date: 2005/08/08 19:38:22 $ * * ==================================================================== * *  Copyright 1999-2004 The Apache Software Foundation * *  Licensed under the Apache License, Version 2.0 (the "License"); *  you may not use this file except in compliance with the License. *  You may obtain a copy of the License at * *      http://www.apache.org/licenses/LICENSE-2.0 * *  Unless required by applicable law or agreed to in writing, software *  distributed under the License is distributed on an "AS IS" BASIS, *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *  See the License for the specific language governing permissions and *  limitations under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation.  For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */package org.apache.commons.httpclient;import java.io.IOException;import java.io.InputStream;import java.io.ByteArrayOutputStream;import java.util.ArrayList;import org.apache.commons.httpclient.util.EncodingUtil;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;/** * A utility class for parsing http header values according to * RFC-2616 Section 4 and 19.3. *  * @author Michael Becke * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a> *  * @since 2.0beta1 */public class HttpParser {    /** Log object for this class. */    private static final Log LOG = LogFactory.getLog(HttpParser.class);        /**     * Constructor for HttpParser.     */    private HttpParser() { }    /**     * Return byte array from an (unchunked) input stream.     * Stop reading when <tt>"\n"</tt> terminator encountered      * If the stream ends before the line terminator is found,     * the last part of the string will still be returned.      * If no input data available, <code>null</code> is returned.     *     * @param inputStream the stream to read from     *     * @throws IOException if an I/O problem occurs     * @return a byte array from the stream     */    public static byte[] readRawLine(InputStream inputStream) throws IOException {        LOG.trace("enter HttpParser.readRawLine()");        ByteArrayOutputStream buf = new ByteArrayOutputStream();        int ch;        while ((ch = inputStream.read()) >= 0) {            buf.write(ch);            if (ch == '\n') { // be tolerant (RFC-2616 Section 19.3)                break;            }        }        if (buf.size() == 0) {            return null;        }        return buf.toByteArray();    }    /**     * Read up to <tt>"\n"</tt> from an (unchunked) input stream.     * If the stream ends before the line terminator is found,     * the last part of the string will still be returned.     * If no input data available, <code>null</code> is returned.     *     * @param inputStream the stream to read from     * @param charset charset of HTTP protocol elements     *     * @throws IOException if an I/O problem occurs     * @return a line from the stream     *      * @since 3.0     */    public static String readLine(InputStream inputStream, String charset) throws IOException {        LOG.trace("enter HttpParser.readLine(InputStream, String)");        byte[] rawdata = readRawLine(inputStream);        if (rawdata == null) {            return null;        }        // strip CR and LF from the end        int len = rawdata.length;        int offset = 0;        if (len > 0) {            if (rawdata[len - 1] == '\n') {                offset++;                if (len > 1) {                    if (rawdata[len - 2] == '\r') {                        offset++;                    }                }            }        }        return EncodingUtil.getString(rawdata, 0, len - offset, charset);    }    /**     * Read up to <tt>"\n"</tt> from an (unchunked) input stream.     * If the stream ends before the line terminator is found,     * the last part of the string will still be returned.     * If no input data available, <code>null</code> is returned     *     * @param inputStream the stream to read from     *     * @throws IOException if an I/O problem occurs     * @return a line from the stream     *      * @deprecated use #readLine(InputStream, String)     */    public static String readLine(InputStream inputStream) throws IOException {        LOG.trace("enter HttpParser.readLine(InputStream)");        return readLine(inputStream, "US-ASCII");    }        /**     * Parses headers from the given stream.  Headers with the same name are not     * combined.     *      * @param is the stream to read headers from     * @param charset the charset to use for reading the data     *      * @return an array of headers in the order in which they were parsed     *      * @throws IOException if an IO error occurs while reading from the stream     * @throws HttpException if there is an error parsing a header value     *      * @since 3.0     */    public static Header[] parseHeaders(InputStream is, String charset) throws IOException, HttpException {        LOG.trace("enter HeaderParser.parseHeaders(InputStream, String)");        ArrayList headers = new ArrayList();        String name = null;        StringBuffer value = null;        for (; ;) {            String line = HttpParser.readLine(is, charset);            if ((line == null) || (line.trim().length() < 1)) {                break;            }            // Parse the header name and value            // Check for folded headers first            // Detect LWS-char see HTTP/1.0 or HTTP/1.1 Section 2.2            // discussion on folded headers            if ((line.charAt(0) == ' ') || (line.charAt(0) == '\t')) {                // we have continuation folded header                // so append value                if (value != null) {                    value.append(' ');                    value.append(line.trim());                }            } else {                // make sure we save the previous name,value pair if present                if (name != null) {                    headers.add(new Header(name, value.toString()));                }                // Otherwise we should have normal HTTP header line                // Parse the header name and value                int colon = line.indexOf(":");                                // START HERITRIX Change                // Don't throw an exception if can't parse.  We want to keep                // going even though header is bad. Rather, create                // pseudo-header.                if (colon < 0) {                    // throw new ProtocolException("Unable to parse header: " +                    //      line);                    name = "HttpClient-Bad-Header-Line-Failed-Parse";                    value = new StringBuffer(line);                } else {                    name = line.substring(0, colon).trim();                    value = new StringBuffer(line.substring(colon + 1).trim());                }                // END HERITRIX change.                            }        }        // make sure we save the last name,value pair if present        if (name != null) {            headers.add(new Header(name, value.toString()));        }                return (Header[]) headers.toArray(new Header[headers.size()]);        }    /**     * Parses headers from the given stream.  Headers with the same name are not     * combined.     *      * @param is the stream to read headers from     *      * @return an array of headers in the order in which they were parsed     *      * @throws IOException if an IO error occurs while reading from the stream     * @throws HttpException if there is an error parsing a header value     *      * @deprecated use #parseHeaders(InputStream, String)     */    public static Header[] parseHeaders(InputStream is) throws IOException, HttpException {        LOG.trace("enter HeaderParser.parseHeaders(InputStream, String)");        return parseHeaders(is, "US-ASCII");    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费成人在线观看| 亚洲成人av一区二区三区| 欧美中文字幕一区二区三区亚洲| 亚洲va韩国va欧美va精品| 久久亚洲精精品中文字幕早川悠里 | 欧美不卡一区二区三区| 99精品国产热久久91蜜凸| 爽爽淫人综合网网站| 国产精品久久久久久亚洲伦| 日韩一区二区三区在线| 91猫先生在线| 不卡的av在线| 国产一区二区调教| 午夜精品免费在线| 亚洲免费观看在线视频| 国产日韩欧美精品综合| 精品国产一区二区三区不卡| 欧美色区777第一页| 成人97人人超碰人人99| 久久国产尿小便嘘嘘尿| 蜜臀av性久久久久av蜜臀妖精| 一区二区免费视频| 综合久久久久综合| 亚洲国产成人午夜在线一区| 久久在线免费观看| 日韩欧美卡一卡二| 欧美一区二区三区视频免费| 欧美日韩中字一区| 在线观看不卡一区| 一本到不卡免费一区二区| 国产成人在线看| 国产乱码精品一区二区三区av| 奇米综合一区二区三区精品视频| 亚洲成av人**亚洲成av**| 一片黄亚洲嫩模| 亚洲精品欧美在线| 一区二区三区四区在线播放| 中文字幕在线视频一区| 中文字幕久久午夜不卡| 国产欧美精品一区aⅴ影院| 久久久综合网站| 久久综合九色综合欧美98| 欧美成人激情免费网| 精品国产乱码久久久久久久 | 黄色日韩三级电影| 久久99精品国产| 国产综合一区二区| 国产在线一区观看| 国产精品99久久久久久有的能看| 国产一区二区电影| 国产91丝袜在线观看| 成人app下载| 91成人在线观看喷潮| 日本高清视频一区二区| 欧洲人成人精品| 欧美区视频在线观看| 欧美一级日韩不卡播放免费| 欧美一区日韩一区| 久久综合久久99| 国产精品入口麻豆原神| 日韩伦理免费电影| 亚洲国产精品一区二区www| 日韩电影网1区2区| 国产一区二三区| 91在线观看成人| 666欧美在线视频| 久久久久九九视频| 亚洲视频在线观看一区| 香蕉加勒比综合久久| 久久99精品视频| 成人午夜看片网址| 欧美午夜精品理论片a级按摩| 欧美一区二区三区在| 国产视频一区在线播放| 亚洲激情在线激情| 黑人精品欧美一区二区蜜桃| 99re8在线精品视频免费播放| 欧美日韩国产高清一区| 国产日韩视频一区二区三区| 中文字幕综合网| 首页国产丝袜综合| 成人一级片在线观看| 99精品国产一区二区三区不卡| 欧美日韩一区二区在线视频| 日韩一区二区三区电影在线观看| 精品88久久久久88久久久| 国产精品家庭影院| 午夜免费欧美电影| 国内成人自拍视频| 日本黄色一区二区| 精品国产乱码久久久久久免费| 国产精品视频一二| 亚洲三级免费电影| 激情成人午夜视频| 色域天天综合网| 日韩一区二区电影网| 亚洲国产精品成人综合| 亚洲18色成人| 成人免费av资源| 在线观看成人小视频| 中文字幕乱码久久午夜不卡| 亚洲图片有声小说| 国产美女视频一区| 欧美日韩高清一区二区三区| 久久久亚洲欧洲日产国码αv| 亚洲视频一二三区| 久久97超碰色| 欧美精品高清视频| 国产精品二区一区二区aⅴ污介绍| 亚洲国产毛片aaaaa无费看| 亚洲一区二区欧美日韩| 国产99久久久国产精品免费看 | 久久精品国产77777蜜臀| 日本韩国一区二区三区视频| 久久综合九色综合欧美亚洲| 午夜视频在线观看一区二区 | 成人av在线一区二区三区| 7777女厕盗摄久久久| 亚洲视频你懂的| 加勒比av一区二区| 欧美二区在线观看| 亚洲综合在线视频| www.日韩精品| 久久中文字幕电影| 日韩精品一二三| 色天天综合色天天久久| 国产欧美一区二区三区网站| 亚洲一区二区三区四区五区黄| 国产毛片精品国产一区二区三区| 欧美久久久久中文字幕| 一区二区免费在线播放| 国产成a人亚洲| 久久日韩精品一区二区五区| 一区二区欧美精品| 91亚洲资源网| 国产精品麻豆视频| 国产精品99久久久久久久vr| 欧美一区二区三区视频免费播放| 亚洲国产精品视频| 成人91在线观看| 亚洲日本一区二区三区| 成人高清av在线| 国产欧美精品区一区二区三区 | 91成人在线精品| 国产精品婷婷午夜在线观看| 99免费精品视频| 中文字幕二三区不卡| 国产成人在线免费观看| 久久精品男人天堂av| 国产一区欧美二区| 日韩欧美卡一卡二| 成人性视频免费网站| 欧美激情自拍偷拍| 成人少妇影院yyyy| 国产精品久久久久久久久久免费看 | 日本女优在线视频一区二区| 8x8x8国产精品| 日本不卡中文字幕| 日韩久久久精品| 国产精品一卡二卡在线观看| 国产精品久久久久久久久动漫 | 欧美中文字幕亚洲一区二区va在线| 亚洲免费在线电影| 欧美性高清videossexo| 亚洲第一久久影院| 91精品国产91久久久久久一区二区| 亚洲午夜影视影院在线观看| 欧美sm极限捆绑bd| 国产精品123| 久久亚洲精精品中文字幕早川悠里| 免费国产亚洲视频| 久久久久久久久久美女| 99久久精品久久久久久清纯| 一区二区高清免费观看影视大全| 欧美日本一区二区在线观看| 精品在线播放免费| 久久蜜桃一区二区| 欧美三级视频在线播放| 日本欧美韩国一区三区| 国产午夜精品一区二区三区视频| 成人av高清在线| 亚洲成精国产精品女| 日韩一级高清毛片| 99久久免费国产| 秋霞成人午夜伦在线观看| 久久精品人人做人人综合 | 日韩欧美中文字幕精品| 国产黄色成人av| 欧美国产日韩a欧美在线观看| 欧美另类久久久品| 国产福利91精品| 一区二区三区在线视频观看| 欧美α欧美αv大片| www.久久精品| 午夜精品爽啪视频| 国产精品美日韩| 欧美一区二区私人影院日本| 99久久99久久精品国产片果冻| 日韩在线卡一卡二| 日韩一级片在线观看|