org.eclipse.jetty.util
类 IO

java.lang.Object
  继承者 org.eclipse.jetty.util.IO

public class IO
extends Object

IO Utilities. Provides stream handling utilities in singleton Threadpool implementation accessed by static members.


字段摘要
static int bufferSize
           
static String CRLF
           
static byte[] CRLF_BYTES
           
 
构造方法摘要
IO()
           
 
方法摘要
static void close(InputStream is)
          closes an input stream, and logs exceptions
static void close(OutputStream os)
          closes an output stream, and logs exceptions
static void close(Reader reader)
          closes a reader, and logs exceptions
static void close(Writer writer)
          closes a writer, and logs exceptions
static void copy(File from, File to)
          Copy files or directories
static void copy(InputStream in, OutputStream out)
          Copy Stream in to Stream out until EOF or exception.
static void copy(InputStream in, OutputStream out, long byteCount)
          Copy Stream in to Stream for byteCount bytes or until EOF or exception.
static void copy(Reader in, Writer out)
          Copy Reader to Writer out until EOF or exception.
static void copy(Reader in, Writer out, long byteCount)
          Copy Reader to Writer for byteCount bytes or until EOF or exception.
static void copyDir(File from, File to)
           
static void copyFile(File from, File to)
           
static void copyThread(InputStream in, OutputStream out)
          Copy Stream in to Stream out until EOF or exception.
static void copyThread(Reader in, Writer out)
          Copy Stream in to Stream out until EOF or exception in own thread
static boolean delete(File file)
          Delete File.
static InputStream getClosedStream()
           
static PrintWriter getNullPrintWriter()
           
static OutputStream getNullStream()
           
static Writer getNullWriter()
           
static byte[] readBytes(InputStream in)
           
static String toString(InputStream in)
          Read input stream to string.
static String toString(InputStream in, String encoding)
          Read input stream to string.
static String toString(Reader in)
          Read input stream to string.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

CRLF

public static final String CRLF
另请参见:
常量字段值

CRLF_BYTES

public static final byte[] CRLF_BYTES

bufferSize

public static int bufferSize
构造方法详细信息

IO

public IO()
方法详细信息

copyThread

public static void copyThread(InputStream in,
                              OutputStream out)
Copy Stream in to Stream out until EOF or exception. in own thread


copy

public static void copy(InputStream in,
                        OutputStream out)
                 throws IOException
Copy Stream in to Stream out until EOF or exception.

抛出:
IOException

copyThread

public static void copyThread(Reader in,
                              Writer out)
Copy Stream in to Stream out until EOF or exception in own thread


copy

public static void copy(Reader in,
                        Writer out)
                 throws IOException
Copy Reader to Writer out until EOF or exception.

抛出:
IOException

copy

public static void copy(InputStream in,
                        OutputStream out,
                        long byteCount)
                 throws IOException
Copy Stream in to Stream for byteCount bytes or until EOF or exception.

抛出:
IOException

copy

public static void copy(Reader in,
                        Writer out,
                        long byteCount)
                 throws IOException
Copy Reader to Writer for byteCount bytes or until EOF or exception.

抛出:
IOException

copy

public static void copy(File from,
                        File to)
                 throws IOException
Copy files or directories

参数:
from -
to -
抛出:
IOException

copyDir

public static void copyDir(File from,
                           File to)
                    throws IOException
抛出:
IOException

copyFile

public static void copyFile(File from,
                            File to)
                     throws IOException
抛出:
IOException

toString

public static String toString(InputStream in)
                       throws IOException
Read input stream to string.

抛出:
IOException

toString

public static String toString(InputStream in,
                              String encoding)
                       throws IOException
Read input stream to string.

抛出:
IOException

toString

public static String toString(Reader in)
                       throws IOException
Read input stream to string.

抛出:
IOException

delete

public static boolean delete(File file)
Delete File. This delete will recursively delete directories - BE CAREFULL

参数:
file - The file to be deleted.

close

public static void close(InputStream is)
closes an input stream, and logs exceptions

参数:
is - the input stream to close

close

public static void close(Reader reader)
closes a reader, and logs exceptions

参数:
reader - the reader to close

close

public static void close(Writer writer)
closes a writer, and logs exceptions

参数:
writer - the writer to close

readBytes

public static byte[] readBytes(InputStream in)
                        throws IOException
抛出:
IOException

close

public static void close(OutputStream os)
closes an output stream, and logs exceptions

参数:
os - the output stream to close

getNullStream

public static OutputStream getNullStream()
返回:
An outputstream to nowhere

getClosedStream

public static InputStream getClosedStream()
返回:
An outputstream to nowhere

getNullWriter

public static Writer getNullWriter()
返回:
An writer to nowhere

getNullPrintWriter

public static PrintWriter getNullPrintWriter()
返回:
An writer to nowhere


Copyright © 2013. All Rights Reserved.