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

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

?? inputstreamrequestentity.java

?? Light in the box 抓取程序。 使用HttpClient
?? JAVA
字號:
/* * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/java/org/apache/commons/httpclient/methods/InputStreamRequestEntity.java,v 1.4 2004/05/17 21:46:03 olegk Exp $ * $Revision: 480424 $ * $Date: 2006-11-29 06:56:49 +0100 (Wed, 29 Nov 2006) $ * * ==================================================================== * *  Licensed to the Apache Software Foundation (ASF) under one or more *  contributor license agreements.  See the NOTICE file distributed with *  this work for additional information regarding copyright ownership. *  The ASF licenses this file to You 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/>. * * [Additional notices, if required by prior licensing conditions] * */package org.apache.commons.httpclient.methods;import java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;/** * A RequestEntity that contains an InputStream. *  * @since 3.0 */public class InputStreamRequestEntity implements RequestEntity {    /**     * The content length will be calculated automatically. This implies     * buffering of the content.     */    public static final int CONTENT_LENGTH_AUTO = -2;        private static final Log LOG = LogFactory.getLog(InputStreamRequestEntity.class);        private long contentLength;        private InputStream content;    /** The buffered request body, if any. */    private byte[] buffer = null;        /** The content type */    private String contentType;    /**     * Creates a new InputStreamRequestEntity with the given content and a content type of     * {@link #CONTENT_LENGTH_AUTO}.     * @param content The content to set.     */    public InputStreamRequestEntity(InputStream content) {        this(content, null);    }        /**     * Creates a new InputStreamRequestEntity with the given content, content type, and a      * content length of {@link #CONTENT_LENGTH_AUTO}.     * @param content The content to set.     * @param contentType The type of the content, or <code>null</code>.     */    public InputStreamRequestEntity(InputStream content, String contentType) {        this(content, CONTENT_LENGTH_AUTO, contentType);    }    /**     * Creates a new InputStreamRequestEntity with the given content and content length.     * @param content The content to set.     * @param contentLength The content size in bytes or a negative number if not known.     *  If {@link #CONTENT_LENGTH_AUTO} is given the content will be buffered in order to      *  determine its size when {@link #getContentLength()} is called.     */    public InputStreamRequestEntity(InputStream content, long contentLength) {        this(content, contentLength, null);    }        /**     * Creates a new InputStreamRequestEntity with the given content, content length, and      * content type.     * @param content The content to set.     * @param contentLength The content size in bytes or a negative number if not known.     *  If {@link #CONTENT_LENGTH_AUTO} is given the content will be buffered in order to      *  determine its size when {@link #getContentLength()} is called.     * @param contentType The type of the content, or <code>null</code>.     */    public InputStreamRequestEntity(InputStream content, long contentLength, String contentType) {        if (content == null) {            throw new IllegalArgumentException("The content cannot be null");        }        this.content = content;        this.contentLength = contentLength;        this.contentType = contentType;    }    /* (non-Javadoc)     * @see org.apache.commons.httpclient.methods.RequestEntity#getContentType()     */    public String getContentType() {        return contentType;    }        /**     * Buffers request body input stream.     */    private void bufferContent() {        if (this.buffer != null) {            // Already been buffered            return;        }        if (this.content != null) {            try {                ByteArrayOutputStream tmp = new ByteArrayOutputStream();                byte[] data = new byte[4096];                int l = 0;                while ((l = this.content.read(data)) >= 0) {                    tmp.write(data, 0, l);                }                this.buffer = tmp.toByteArray();                this.content = null;                this.contentLength = buffer.length;            } catch (IOException e) {                LOG.error(e.getMessage(), e);                this.buffer = null;                this.content = null;                this.contentLength = 0;            }        }    }        /**     * Tests if this method is repeatable.  Only <code>true</code> if the content has been     * buffered.     *      * @see #getContentLength()     */    public boolean isRepeatable() {        return buffer != null;    }    /* (non-Javadoc)     * @see org.apache.commons.httpclient.RequestEntity#writeRequest(java.io.OutputStream)     */    public void writeRequest(OutputStream out) throws IOException {                if (content != null) {            byte[] tmp = new byte[4096];            int total = 0;            int i = 0;            while ((i = content.read(tmp)) >= 0) {                out.write(tmp, 0, i);                total += i;            }                } else if (buffer != null) {            out.write(buffer);        } else {            throw new IllegalStateException("Content must be set before entity is written");        }    }    /**     * Gets the content length.  If the content length has not been set, the content will be     * buffered to determine the actual content length.     */    public long getContentLength() {        if (contentLength == CONTENT_LENGTH_AUTO && buffer == null) {            bufferContent();        }        return contentLength;    }    /**     * @return Returns the content.     */    public InputStream getContent() {        return content;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本不卡1234视频| 日韩码欧中文字| 成人一区二区视频| 国产一区二区视频在线| www国产成人| 成人精品免费网站| 国产日韩欧美激情| 洋洋成人永久网站入口| 欧美绝品在线观看成人午夜影视| 天天色 色综合| 欧美精品一区二区三区一线天视频| 国产精品91一区二区| 中文字幕亚洲综合久久菠萝蜜| 色婷婷亚洲精品| 男女男精品视频| 国产欧美va欧美不卡在线| 91免费精品国自产拍在线不卡| 亚洲一区二区高清| 亚洲精品在线三区| 91欧美一区二区| 日本伊人精品一区二区三区观看方式| 欧美mv日韩mv| 99久久婷婷国产| 天堂午夜影视日韩欧美一区二区| 久久噜噜亚洲综合| 欧美天天综合网| 国产福利一区二区三区视频在线| 一区二区激情小说| 久久久久99精品国产片| 91成人网在线| 成人综合婷婷国产精品久久| 日韩成人精品在线| 国产精品久久久久久久久久久免费看| 欧美乱妇20p| 99久久伊人精品| 久久国产剧场电影| 一区二区三区高清| 国产婷婷色一区二区三区 | 国产成人在线视频网址| 中文字幕色av一区二区三区| 91.com在线观看| 成人午夜短视频| 免费黄网站欧美| 亚洲主播在线观看| 国产性天天综合网| 日韩一卡二卡三卡国产欧美| 99精品国产热久久91蜜凸| 精品一区二区免费在线观看| 一区二区三区在线免费| 国产欧美一区二区三区网站| 日韩亚洲欧美中文三级| 欧美视频日韩视频| 99亚偷拍自图区亚洲| 韩国精品在线观看| 日韩国产精品久久| 亚洲成人免费视| 一区二区三区在线视频观看| 综合欧美亚洲日本| 久久久久久久久久看片| 欧美α欧美αv大片| 欧美精品乱码久久久久久| 99久久99久久精品免费看蜜桃 | 国产日韩精品久久久| 日韩欧美三级在线| 欧美日韩不卡一区| 欧美在线看片a免费观看| 99视频一区二区| 从欧美一区二区三区| 老司机免费视频一区二区三区| 亚洲第四色夜色| 亚洲国产综合在线| 五月天亚洲精品| 首页欧美精品中文字幕| 亚洲成在人线在线播放| 亚洲一区中文在线| 香蕉成人啪国产精品视频综合网| 亚洲主播在线观看| 日韩综合小视频| 奇米777欧美一区二区| 日本女人一区二区三区| 青青草国产成人av片免费| 蜜臀国产一区二区三区在线播放| 日本vs亚洲vs韩国一区三区二区| 日本午夜精品一区二区三区电影| 日韩av一级电影| 久久激五月天综合精品| 国内精品第一页| 福利电影一区二区三区| 成人午夜精品在线| 91丝袜高跟美女视频| 欧美日韩在线不卡| 日韩欧美色电影| 国产农村妇女精品| 亚洲视频在线一区二区| 亚洲一区二区三区视频在线| 午夜精品在线看| 久久精品99久久久| 高清国产一区二区三区| 91女神在线视频| 555夜色666亚洲国产免| 精品久久免费看| 久久精品免视看| 亚洲精品免费电影| 日本aⅴ免费视频一区二区三区| 奇米影视一区二区三区小说| 国产精品1区2区| 91蜜桃在线观看| 91精品国产欧美一区二区18| 久久婷婷久久一区二区三区| 亚洲区小说区图片区qvod| 日韩专区在线视频| 国产不卡免费视频| 欧美综合亚洲图片综合区| 精品噜噜噜噜久久久久久久久试看 | 91成人在线精品| 日韩欧美在线一区二区三区| 国产精品久久久久久久久久久免费看| 亚洲午夜一区二区| 国产麻豆精品95视频| 在线观看网站黄不卡| 久久久久久**毛片大全| 亚洲主播在线观看| 国产成人啪免费观看软件| 欧美三级在线播放| 欧美激情中文不卡| 免费在线观看一区| 91欧美一区二区| 亚洲精品一区二区三区在线观看| 中文字幕一区二区三区乱码在线| 青青草国产成人av片免费| 99re热视频这里只精品| 亚洲精品一区二区在线观看| 亚洲成在线观看| 99久久777色| 久久婷婷成人综合色| 五月综合激情日本mⅴ| 日韩欧美一二三四区| 亚洲精品一卡二卡| 国产麻豆成人精品| 日韩欧美一级在线播放| 一区二区三区日韩精品视频| 国产精品一区三区| 日韩美女视频一区二区在线观看| 亚洲小说欧美激情另类| 岛国精品在线播放| 日韩欧美一级片| 日本免费在线视频不卡一不卡二 | 国产成人午夜精品5599| 欧美精品三级日韩久久| 亚洲日本va在线观看| 国产福利一区在线| 26uuu国产在线精品一区二区| 亚洲成人第一页| 日本丶国产丶欧美色综合| 国产精品国产a级| 成人丝袜视频网| 欧美激情一区二区三区四区| 国产呦萝稀缺另类资源| 精品久久久久久久久久久院品网 | 99久久精品一区| 国产精品欧美极品| 国产精品一区二区男女羞羞无遮挡| 日韩午夜激情电影| 麻豆精品在线播放| 欧美成人一区二区三区片免费| 日本人妖一区二区| 日韩精品资源二区在线| 成人高清伦理免费影院在线观看| 久久精品免费在线观看| 国产99一区视频免费| 中文字幕成人网| 99久久精品国产网站| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 成人av免费网站| 亚洲男人的天堂av| 欧美系列在线观看| 亚洲成人免费电影| 欧美一区二区三区系列电影| 日本亚洲最大的色成网站www| 日韩欧美国产麻豆| 韩日欧美一区二区三区| 久久久久久久精| 成人午夜免费av| 依依成人精品视频| 4438x亚洲最大成人网| 乱中年女人伦av一区二区| 久久亚洲私人国产精品va媚药| 国产成人高清在线| 亚洲精品亚洲人成人网在线播放| 欧美影院一区二区| 九九精品视频在线看| 国产日韩欧美麻豆| 在线观看亚洲专区| 毛片不卡一区二区| 国产精品人人做人人爽人人添 | 欧美麻豆精品久久久久久| 麻豆国产欧美日韩综合精品二区 | 日韩精品中午字幕| 国产不卡高清在线观看视频| 亚洲综合无码一区二区|