org.apache.ftpserver.util
Class IoUtils

java.lang.Object
  extended byorg.apache.ftpserver.util.IoUtils

public class IoUtils
extends java.lang.Object

IO utility methods.

Author:
Rana Bhattacharyya

Constructor Summary
IoUtils()
           
 
Method Summary
static void close(java.io.InputStream is)
          No exception InputStream close method.
static void close(java.io.OutputStream os)
          No exception OutputStream close method.
static void close(java.io.Reader rd)
          No exception java.io.Reader close method.
static void close(java.io.Writer wr)
          No exception java.io.Writer close method.
static void copy(java.io.InputStream input, java.io.OutputStream output, int bufferSize)
          Copy chars from a InputStream to a OutputStream.
static void copy(java.io.Reader input, java.io.Writer output, int bufferSize)
          Copy chars from a Reader to a Writer.
static java.io.BufferedInputStream getBufferedInputStream(java.io.InputStream in)
          Get a BufferedInputStream.
static java.io.BufferedOutputStream getBufferedOutputStream(java.io.OutputStream out)
          Get a BufferedOutputStream.
static java.io.BufferedReader getBufferedReader(java.io.Reader rd)
          Get BufferedReader.
static java.io.BufferedWriter getBufferedWriter(java.io.Writer wr)
          Get BufferedWriter.
static java.lang.String getStackTrace(java.lang.Throwable ex)
          Get exception stack trace.
static java.io.File getUniqueFile(java.io.File oldFile)
          Get unique file object.
static java.lang.String readFully(java.io.InputStream input)
          Read fully from stream
static java.lang.String readFully(java.io.Reader reader)
          Read fully from reader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IoUtils

public IoUtils()
Method Detail

getBufferedInputStream

public static java.io.BufferedInputStream getBufferedInputStream(java.io.InputStream in)
Get a BufferedInputStream.


getBufferedOutputStream

public static java.io.BufferedOutputStream getBufferedOutputStream(java.io.OutputStream out)
Get a BufferedOutputStream.


getBufferedReader

public static java.io.BufferedReader getBufferedReader(java.io.Reader rd)
Get BufferedReader.


getBufferedWriter

public static java.io.BufferedWriter getBufferedWriter(java.io.Writer wr)
Get BufferedWriter.


getUniqueFile

public static java.io.File getUniqueFile(java.io.File oldFile)
Get unique file object.


close

public static void close(java.io.InputStream is)
No exception InputStream close method.


close

public static void close(java.io.OutputStream os)
No exception OutputStream close method.


close

public static void close(java.io.Reader rd)
No exception java.io.Reader close method.


close

public static void close(java.io.Writer wr)
No exception java.io.Writer close method.


getStackTrace

public static java.lang.String getStackTrace(java.lang.Throwable ex)
Get exception stack trace.


copy

public static void copy(java.io.Reader input,
                        java.io.Writer output,
                        int bufferSize)
                 throws java.io.IOException
Copy chars from a Reader to a Writer.

Parameters:
bufferSize - Size of internal buffer to use.
Throws:
java.io.IOException

copy

public static void copy(java.io.InputStream input,
                        java.io.OutputStream output,
                        int bufferSize)
                 throws java.io.IOException
Copy chars from a InputStream to a OutputStream.

Parameters:
bufferSize - Size of internal buffer to use.
Throws:
java.io.IOException

readFully

public static java.lang.String readFully(java.io.Reader reader)
                                  throws java.io.IOException
Read fully from reader

Throws:
java.io.IOException

readFully

public static java.lang.String readFully(java.io.InputStream input)
                                  throws java.io.IOException
Read fully from stream

Throws:
java.io.IOException


Copyright © 2001-2007 Codehaus. All Rights Reserved.