org.apache.ftpserver.util
Class IoUtils

java.lang.Object
  extended by org.apache.ftpserver.util.IoUtils

public class IoUtils
extends Object

IO utility methods.

Author:
Rana Bhattacharyya

Constructor Summary
IoUtils()
           
 
Method Summary
static void close(InputStream is)
          No exception InputStream close method.
static void close(OutputStream os)
          No exception OutputStream close method.
static void close(Reader rd)
          No exception java.io.Reader close method.
static void close(Writer wr)
          No exception java.io.Writer close method.
static void copy(InputStream input, OutputStream output, int bufferSize)
          Copy chars from a InputStream to a OutputStream.
static void copy(Reader input, Writer output, int bufferSize)
          Copy chars from a Reader to a Writer.
static BufferedInputStream getBufferedInputStream(InputStream in)
          Get a BufferedInputStream.
static BufferedOutputStream getBufferedOutputStream(OutputStream out)
          Get a BufferedOutputStream.
static BufferedReader getBufferedReader(Reader rd)
          Get BufferedReader.
static BufferedWriter getBufferedWriter(Writer wr)
          Get BufferedWriter.
static String getStackTrace(Throwable ex)
          Get exception stack trace.
static File getUniqueFile(File oldFile)
          Get unique file object.
static String readFully(InputStream input)
          Read fully from stream
static String readFully(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 BufferedInputStream getBufferedInputStream(InputStream in)
Get a BufferedInputStream.


getBufferedOutputStream

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


getBufferedReader

public static BufferedReader getBufferedReader(Reader rd)
Get BufferedReader.


getBufferedWriter

public static BufferedWriter getBufferedWriter(Writer wr)
Get BufferedWriter.


getUniqueFile

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


close

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


close

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


close

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


close

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


getStackTrace

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


copy

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

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

copy

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

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

readFully

public static String readFully(Reader reader)
                        throws IOException
Read fully from reader

Throws:
IOException

readFully

public static String readFully(InputStream input)
                        throws IOException
Read fully from stream

Throws:
IOException


Copyright © 2001-2012 Codehaus. All Rights Reserved.