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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ioutils.java

?? < JavaME核心技術(shù)最佳實(shí)踐>>的全部源代碼
?? JAVA
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/*
 * Copyright 2001-2006 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.
 */
package org.apache.commons.io;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.CharArrayWriter;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import org.apache.commons.io.output.ByteArrayOutputStream;

/**
 * General IO stream manipulation utilities.
 * <p>
 * This class provides static utility methods for input/output operations.
 * <ul>
 * <li>closeQuietly - these methods close a stream ignoring nulls and exceptions
 * <li>toXxx/read - these methods read data from a stream
 * <li>write - these methods write data to a stream
 * <li>copy - these methods copy all the data from one stream to another
 * <li>contentEquals - these methods compare the content of two streams
 * </ul>
 * <p>
 * The byte-to-char methods and char-to-byte methods involve a conversion step.
 * Two methods are provided in each case, one that uses the platform default
 * encoding and the other which allows you to specify an encoding. You are
 * encouraged to always specify an encoding because relying on the platform
 * default can lead to unexpected results, for example when moving from
 * development to production.
 * <p>
 * All the methods in this class that read a stream are buffered internally.
 * This means that there is no cause to use a <code>BufferedInputStream</code>
 * or <code>BufferedReader</code>. The default buffer size of 4K has been shown
 * to be efficient in tests.
 * <p>
 * Wherever possible, the methods in this class do <em>not</em> flush or close
 * the stream. This is to avoid making non-portable assumptions about the
 * streams' origin and further use. Thus the caller is still responsible for
 * closing streams after use.
 * <p>
 * Origin of code: Excalibur.
 *
 * @author Peter Donald
 * @author Jeff Turner
 * @author Matthew Hawthorne
 * @author Stephen Colebourne
 * @author Gareth Davis
 * @author Ian Springer
 * @author Niall Pemberton
 * @author Sandy McArthur
 * @version $Id: IOUtils.java 385117 2006-03-11 18:07:02Z scolebourne $
 */
public class IOUtils {
    // NOTE: This class is focussed on InputStream, OutputStream, Reader and
    // Writer. Each method should take at least one of these as a parameter,
    // or return one of them.

    /**
     * The Unix directory separator character.
     */
    public static final char DIR_SEPARATOR_UNIX = '/';
    /**
     * The Windows directory separator character.
     */
    public static final char DIR_SEPARATOR_WINDOWS = '\\';
    /**
     * The system directory separator character.
     */
    public static final char DIR_SEPARATOR = File.separatorChar;
    /**
     * The Unix line separator string.
     */
    public static final String LINE_SEPARATOR_UNIX = "\n";
    /**
     * The Windows line separator string.
     */
    public static final String LINE_SEPARATOR_WINDOWS = "\r\n";
    /**
     * The system line separator string.
     */
    public static final String LINE_SEPARATOR;
    static {
        // avoid security issues
        StringWriter buf = new StringWriter(4);
        PrintWriter out = new PrintWriter(buf);
        out.println();
        LINE_SEPARATOR = buf.toString();
    }

    /**
     * The default buffer size to use.
     */
    private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;

    /**
     * Instances should NOT be constructed in standard programming.
     */
    public IOUtils() {
        super();
    }

    //-----------------------------------------------------------------------
    /**
     * Unconditionally close an <code>Reader</code>.
     * <p>
     * Equivalent to {@link Reader#close()}, except any exceptions will be ignored.
     * This is typically used in finally blocks.
     *
     * @param input  the Reader to close, may be null or already closed
     */
    public static void closeQuietly(Reader input) {
        try {
            if (input != null) {
                input.close();
            }
        } catch (IOException ioe) {
            // ignore
        }
    }

    /**
     * Unconditionally close a <code>Writer</code>.
     * <p>
     * Equivalent to {@link Writer#close()}, except any exceptions will be ignored.
     * This is typically used in finally blocks.
     *
     * @param output  the Writer to close, may be null or already closed
     */
    public static void closeQuietly(Writer output) {
        try {
            if (output != null) {
                output.close();
            }
        } catch (IOException ioe) {
            // ignore
        }
    }

    /**
     * Unconditionally close an <code>InputStream</code>.
     * <p>
     * Equivalent to {@link InputStream#close()}, except any exceptions will be ignored.
     * This is typically used in finally blocks.
     *
     * @param input  the InputStream to close, may be null or already closed
     */
    public static void closeQuietly(InputStream input) {
        try {
            if (input != null) {
                input.close();
            }
        } catch (IOException ioe) {
            // ignore
        }
    }

    /**
     * Unconditionally close an <code>OutputStream</code>.
     * <p>
     * Equivalent to {@link OutputStream#close()}, except any exceptions will be ignored.
     * This is typically used in finally blocks.
     *
     * @param output  the OutputStream to close, may be null or already closed
     */
    public static void closeQuietly(OutputStream output) {
        try {
            if (output != null) {
                output.close();
            }
        } catch (IOException ioe) {
            // ignore
        }
    }

    // read toByteArray
    //-----------------------------------------------------------------------
    /**
     * Get the contents of an <code>InputStream</code> as a <code>byte[]</code>.
     * <p>
     * This method buffers the input internally, so there is no need to use a
     * <code>BufferedInputStream</code>.
     * 
     * @param input  the <code>InputStream</code> to read from
     * @return the requested byte array
     * @throws NullPointerException if the input is null
     * @throws IOException if an I/O error occurs
     */
    public static byte[] toByteArray(InputStream input) throws IOException {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        copy(input, output);
        return output.toByteArray();
    }

    /**
     * Get the contents of a <code>Reader</code> as a <code>byte[]</code>
     * using the default character encoding of the platform.
     * <p>
     * This method buffers the input internally, so there is no need to use a
     * <code>BufferedReader</code>.
     * 
     * @param input  the <code>Reader</code> to read from
     * @return the requested byte array
     * @throws NullPointerException if the input is null
     * @throws IOException if an I/O error occurs
     */
    public static byte[] toByteArray(Reader input) throws IOException {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        copy(input, output);
        return output.toByteArray();
    }

    /**
     * Get the contents of a <code>Reader</code> as a <code>byte[]</code>
     * using the specified character encoding.
     * <p>
     * Character encoding names can be found at
     * <a href="http://www.iana.org/assignments/character-sets">IANA</a>.
     * <p>
     * This method buffers the input internally, so there is no need to use a
     * <code>BufferedReader</code>.
     * 
     * @param input  the <code>Reader</code> to read from
     * @param encoding  the encoding to use, null means platform default
     * @return the requested byte array
     * @throws NullPointerException if the input is null
     * @throws IOException if an I/O error occurs
     * @since Commons IO 1.1
     */
    public static byte[] toByteArray(Reader input, String encoding)
            throws IOException {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        copy(input, output, encoding);
        return output.toByteArray();
    }

    /**
     * Get the contents of a <code>String</code> as a <code>byte[]</code>
     * using the default character encoding of the platform.
     * <p>
     * This is the same as {@link String#getBytes()}.
     * 
     * @param input  the <code>String</code> to convert
     * @return the requested byte array
     * @throws NullPointerException if the input is null
     * @throws IOException if an I/O error occurs (never occurs)
     * @deprecated Use {@link String#getBytes()}
     */
    public static byte[] toByteArray(String input) throws IOException {
        return input.getBytes();
    }

    // read char[]
    //-----------------------------------------------------------------------
    /**
     * Get the contents of an <code>InputStream</code> as a character array
     * using the default character encoding of the platform.
     * <p>
     * This method buffers the input internally, so there is no need to use a
     * <code>BufferedInputStream</code>.
     * 
     * @param is  the <code>InputStream</code> to read from
     * @return the requested character array
     * @throws NullPointerException if the input is null
     * @throws IOException if an I/O error occurs
     * @since Commons IO 1.1
     */
    public static char[] toCharArray(InputStream is) throws IOException {
        CharArrayWriter output = new CharArrayWriter();
        copy(is, output);
        return output.toCharArray();
    }

    /**
     * Get the contents of an <code>InputStream</code> as a character array
     * using the specified character encoding.
     * <p>
     * Character encoding names can be found at
     * <a href="http://www.iana.org/assignments/character-sets">IANA</a>.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二| 欧美激情一区二区三区蜜桃视频| 亚洲综合在线观看视频| 成人综合婷婷国产精品久久| 中文字幕一区二区三区乱码在线 | 国产精品一区二区无线| 中文字幕不卡在线| 欧美三级视频在线观看 | 久久一区二区三区国产精品| 亚洲国产精品自拍| 欧美一级高清大全免费观看| 日韩精品一级中文字幕精品视频免费观看| 91精品国产综合久久久久久久久久| 亚洲精品高清视频在线观看| 91精品国模一区二区三区| 国产精品一区久久久久| 亚洲精品视频自拍| 制服丝袜日韩国产| 国产激情精品久久久第一区二区| 国产精品嫩草99a| 欧美三区免费完整视频在线观看| 亚洲电影视频在线| 国产女同性恋一区二区| 日韩精品一区二区三区在线 | 精品国产乱码久久久久久久| 丁香激情综合国产| 狠狠狠色丁香婷婷综合激情| 综合久久久久久| 欧美精品一区二区久久久 | 国产成人在线视频网站| 日韩精品一级二级| 午夜精品在线看| 亚洲综合激情网| 精品电影一区二区| 欧美日韩一二三| 欧美性视频一区二区三区| 国产不卡视频一区| 国产成人免费视频网站| 青青草原综合久久大伊人精品| 国产精品久久久久久久第一福利 | 天天影视色香欲综合网老头| 一区二区三区四区精品在线视频| 中文字幕一区二区三区乱码在线| 中文字幕免费观看一区| 国产拍揄自揄精品视频麻豆| 久久亚洲精品小早川怜子| 欧美一区午夜视频在线观看| 在线免费亚洲电影| 色琪琪一区二区三区亚洲区| 91国偷自产一区二区三区观看| 国产乱理伦片在线观看夜一区| 国内成+人亚洲+欧美+综合在线 | 狠狠色丁香婷综合久久| 美女脱光内衣内裤视频久久网站| 日韩av网站免费在线| 蜜臀av性久久久久蜜臀aⅴ| 精品综合久久久久久8888| 久久精品国产久精国产爱| 日本大胆欧美人术艺术动态| 亚洲大片在线观看| 久久99精品久久久| 国产69精品久久久久毛片| 国产一区二区三区日韩| 色综合久久中文字幕综合网| 久久久精品tv| 亚洲色欲色欲www| 免费高清视频精品| 97se亚洲国产综合在线| 在线观看视频一区二区| 欧美日韩一区久久| 亚洲色图欧美偷拍| 国内不卡的二区三区中文字幕| 激情综合亚洲精品| 亚洲国产视频一区| 国产资源在线一区| 欧美日韩国产综合久久| 欧美一区二区美女| 九九九精品视频| 不卡一区在线观看| 精品国产免费久久 | 午夜精品福利一区二区三区蜜桃| 国产色一区二区| 久久久精品中文字幕麻豆发布| 欧美人妖巨大在线| 另类小说视频一区二区| 欧美日本一区二区在线观看| 7777精品伊人久久久大香线蕉最新版| 91精品国产91久久久久久最新毛片| 丁香网亚洲国际| 欧美电影一区二区三区| 精品一区二区久久久| 激情文学综合网| 56国语精品自产拍在线观看| 精品久久免费看| 欧美国产一区二区在线观看| 国产一区二区毛片| 成人永久aaa| 国产精品视频第一区| 成人激情免费电影网址| 精品国精品国产尤物美女| 视频一区视频二区在线观看| 欧美一区午夜精品| 蜜桃av噜噜一区| 欧美成人a∨高清免费观看| 毛片av一区二区三区| 精品日产卡一卡二卡麻豆| 91色视频在线| 亚洲一级在线观看| 久久免费电影网| 日本高清不卡aⅴ免费网站| 亚洲一区自拍偷拍| 精品久久久久久综合日本欧美| 五月婷婷另类国产| 国产色产综合产在线视频| 高清不卡在线观看| 日韩成人一区二区| 国产精品乱码一区二区三区软件 | 一区二区三区日韩欧美| 制服丝袜中文字幕亚洲| 懂色av一区二区在线播放| 一区av在线播放| 久久久亚洲精华液精华液精华液 | 成人18视频日本| 国产精品天干天干在线综合| 色婷婷一区二区| 91福利精品视频| 制服丝袜一区二区三区| 色嗨嗨av一区二区三区| 欧美一区二区视频在线观看2020| 91精品国产综合久久小美女| 日韩一级片在线播放| 久久精品一区二区三区不卡| 亚洲午夜精品17c| 亚洲色图在线视频| 日本高清无吗v一区| 亚洲国产精品久久一线不卡| 久久青草欧美一区二区三区| 91浏览器打开| 国产精品乡下勾搭老头1| 日韩精品国产精品| 亚洲va欧美va国产va天堂影院| 综合久久久久久| 国产精品九色蝌蚪自拍| 中文字幕乱码一区二区免费| 在线视频综合导航| 99久久99久久免费精品蜜臀| 精品在线观看视频| 国产精品99久久久| 蜜臀久久99精品久久久久久9| 亚洲第一会所有码转帖| 久久久91精品国产一区二区三区| 欧美一区二区观看视频| 国产日韩欧美高清在线| 亚洲免费高清视频在线| 欧美aaaaaa午夜精品| 成人免费看视频| 88在线观看91蜜桃国自产| 2欧美一区二区三区在线观看视频| 久久久噜噜噜久久人人看| 亚洲精品日韩综合观看成人91| 久久福利视频一区二区| 99精品视频在线免费观看| 欧美电影免费观看高清完整版在| 26uuu国产电影一区二区| 亚洲精品你懂的| 国产精品 日产精品 欧美精品| 在线免费观看一区| 久久久久久久久免费| 日本不卡中文字幕| 91行情网站电视在线观看高清版| 久久蜜桃av一区二区天堂| 亚洲午夜av在线| 一本大道av伊人久久综合| 精品91自产拍在线观看一区| 亚洲欧美日韩精品久久久久| 国产精品亚洲第一区在线暖暖韩国| 欧美日韩激情一区二区三区| 国产精品第13页| www.久久精品| ...xxx性欧美| yourporn久久国产精品| 国产午夜三级一区二区三| 精品无码三级在线观看视频| 欧美一区午夜视频在线观看| 午夜精品免费在线观看| 欧美日韩午夜影院| 亚洲第一主播视频| 欧美裸体一区二区三区| 日本成人在线视频网站| 欧美va日韩va| 国产suv一区二区三区88区| 精品国内片67194| 国产91精品欧美| 亚洲黄色片在线观看| 欧美揉bbbbb揉bbbbb| 日韩精品一卡二卡三卡四卡无卡| 欧美裸体一区二区三区| 国产揄拍国内精品对白| 欧美激情一区在线| 97久久精品人人做人人爽50路|