Secure iNet Factory

com.jscape.util
Class IOTools

java.lang.Object
  extended by com.jscape.util.IOTools

public class IOTools
extends java.lang.Object

I/O tools.

Author:
Alex Usun

Field Summary
static int EOF
           
 
Method Summary
static void close(java.nio.channels.Channel channel)
          Closes channel.
static void close(java.io.Closeable target)
           
static void close(java.net.DatagramSocket socket)
          Closes the specified socket without throwing any exception.
static void close(java.io.InputStream stream)
          Closes the specified stream without throwing any exception.
static void close(java.io.OutputStream stream)
          Closes the specified stream without throwing any exception.
static void close(java.io.RandomAccessFile file)
          Closes random access file.
static void close(java.io.Reader reader)
          Closes the specified reader without throwing any exception.
static void close(java.net.ServerSocket socket)
           
static void close(java.net.Socket socket)
          Closes the specified socket without throwing any exception.
static void close(java.io.Writer writer)
          Closes the specified writer without throwing any exception.
static void copy(java.io.BufferedReader in, java.io.BufferedWriter out)
           
static long copy(java.io.File source, java.io.File destination)
           
static long copy(java.io.InputStream in, java.io.OutputStream out)
           
static long copy(java.io.InputStream in, java.io.OutputStream out, int bufferSize)
           
static long copy(java.io.Reader in, java.io.Writer out)
           
static java.io.IOException ioException(java.lang.Throwable error)
           
static void read(com.jscape.util.Buffer buf, int length, java.io.InputStream in)
           
static byte[] read(byte[] data, java.io.InputStream in)
           
static byte[] read(byte[] data, int off, int len, java.io.InputStream in)
           
static int read(java.io.InputStream in)
           
static byte[] readFile(java.io.File file)
           
static java.lang.String readFile(java.io.File file, java.lang.String charset)
           
static byte[] readFile(java.io.InputStream in)
           
static java.lang.String readFile(java.io.Reader reader)
           
static java.util.Properties readPropertiesFile(java.io.File file)
           
static java.util.Properties readPropertiesFile(java.lang.String path)
           
static java.util.Properties readPropertiesResource(java.lang.Class aClass, java.lang.String path)
           
static int readSequence(java.io.InputStream in, com.jscape.util.Buffer buf, byte[] eol, boolean leaveEol)
           
static int readSequence(java.io.InputStream in, com.jscape.util.Buffer buf, byte[] eol, boolean leaveEol, int maxSize)
           
static byte[] readSequence(java.io.InputStream in, byte[] eol, boolean leaveEol)
           
static int readSequence(java.io.Reader reader, java.lang.StringBuffer buf, java.lang.String eol, boolean leaveEol)
           
static int readSequence(java.io.Reader reader, java.lang.StringBuffer buf, java.lang.String eol, boolean leaveEol, int maxSize)
           
static void writeFile(byte[] data, java.io.File file)
           
static void writeFile(byte[] data, java.io.OutputStream out)
           
static void writeFile(java.lang.String data, java.io.File file, java.lang.String charset)
           
static void writeFile(java.lang.String data, java.io.Writer writer)
           
static void writePropertiesFile(java.util.Properties properties, java.lang.String header, java.io.File file)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOF

public static final int EOF
See Also:
Constant Field Values
Method Detail

close

public static void close(java.io.InputStream stream)
Closes the specified stream without throwing any exception.

Parameters:
stream - stream to close

close

public static void close(java.io.OutputStream stream)
Closes the specified stream without throwing any exception.

Parameters:
stream - stream to close

close

public static void close(java.io.Reader reader)
Closes the specified reader without throwing any exception.

Parameters:
reader - reader to close

close

public static void close(java.io.Writer writer)
Closes the specified writer without throwing any exception.

Parameters:
writer - writer to close

close

public static void close(java.net.Socket socket)
Closes the specified socket without throwing any exception.

Parameters:
socket - socket to close

close

public static void close(java.net.ServerSocket socket)

close

public static void close(java.net.DatagramSocket socket)
Closes the specified socket without throwing any exception.

Parameters:
socket - socket to close

close

public static void close(java.io.Closeable target)

close

public static void close(java.io.RandomAccessFile file)
Closes random access file.

Parameters:
file - file

close

public static void close(java.nio.channels.Channel channel)
Closes channel.

Parameters:
channel - channel

read

public static int read(java.io.InputStream in)
                throws java.io.IOException
Throws:
java.io.IOException

read

public static byte[] read(byte[] data,
                          java.io.InputStream in)
                   throws java.io.IOException
Throws:
java.io.IOException

read

public static byte[] read(byte[] data,
                          int off,
                          int len,
                          java.io.InputStream in)
                   throws java.io.IOException
Throws:
java.io.IOException

read

public static void read(com.jscape.util.Buffer buf,
                        int length,
                        java.io.InputStream in)
                 throws java.io.IOException
Throws:
java.io.IOException

readSequence

public static byte[] readSequence(java.io.InputStream in,
                                  byte[] eol,
                                  boolean leaveEol)
                           throws java.io.IOException
Throws:
java.io.IOException

readSequence

public static int readSequence(java.io.InputStream in,
                               com.jscape.util.Buffer buf,
                               byte[] eol,
                               boolean leaveEol)
                        throws java.io.IOException
Throws:
java.io.IOException

readSequence

public static int readSequence(java.io.InputStream in,
                               com.jscape.util.Buffer buf,
                               byte[] eol,
                               boolean leaveEol,
                               int maxSize)
                        throws java.io.IOException
Throws:
java.io.IOException

readSequence

public static int readSequence(java.io.Reader reader,
                               java.lang.StringBuffer buf,
                               java.lang.String eol,
                               boolean leaveEol)
                        throws java.io.IOException
Throws:
java.io.IOException

readSequence

public static int readSequence(java.io.Reader reader,
                               java.lang.StringBuffer buf,
                               java.lang.String eol,
                               boolean leaveEol,
                               int maxSize)
                        throws java.io.IOException
Throws:
java.io.IOException

readFile

public static byte[] readFile(java.io.InputStream in)
                       throws java.io.IOException
Throws:
java.io.IOException

readFile

public static byte[] readFile(java.io.File file)
                       throws java.io.IOException
Throws:
java.io.IOException

readFile

public static java.lang.String readFile(java.io.Reader reader)
                                 throws java.io.IOException
Throws:
java.io.IOException

readFile

public static java.lang.String readFile(java.io.File file,
                                        java.lang.String charset)
                                 throws java.io.IOException
Throws:
java.io.IOException

writeFile

public static void writeFile(byte[] data,
                             java.io.OutputStream out)
                      throws java.io.IOException
Throws:
java.io.IOException

writeFile

public static void writeFile(byte[] data,
                             java.io.File file)
                      throws java.io.IOException
Throws:
java.io.IOException

writeFile

public static void writeFile(java.lang.String data,
                             java.io.Writer writer)
                      throws java.io.IOException
Throws:
java.io.IOException

writeFile

public static void writeFile(java.lang.String data,
                             java.io.File file,
                             java.lang.String charset)
                      throws java.io.IOException
Throws:
java.io.IOException

writePropertiesFile

public static void writePropertiesFile(java.util.Properties properties,
                                       java.lang.String header,
                                       java.io.File file)
                                throws java.io.IOException
Throws:
java.io.IOException

readPropertiesFile

public static java.util.Properties readPropertiesFile(java.io.File file)
                                               throws java.io.IOException
Throws:
java.io.IOException

readPropertiesFile

public static java.util.Properties readPropertiesFile(java.lang.String path)
                                               throws java.io.IOException
Throws:
java.io.IOException

readPropertiesResource

public static java.util.Properties readPropertiesResource(java.lang.Class aClass,
                                                          java.lang.String path)
                                                   throws java.io.IOException
Throws:
java.io.IOException

copy

public static long copy(java.io.InputStream in,
                        java.io.OutputStream out)
                 throws java.io.IOException
Throws:
java.io.IOException

copy

public static long copy(java.io.InputStream in,
                        java.io.OutputStream out,
                        int bufferSize)
                 throws java.io.IOException
Throws:
java.io.IOException

copy

public static long copy(java.io.Reader in,
                        java.io.Writer out)
                 throws java.io.IOException
Throws:
java.io.IOException

copy

public static void copy(java.io.BufferedReader in,
                        java.io.BufferedWriter out)
                 throws java.io.IOException
Throws:
java.io.IOException

copy

public static long copy(java.io.File source,
                        java.io.File destination)
                 throws java.io.IOException
Throws:
java.io.IOException

ioException

public static java.io.IOException ioException(java.lang.Throwable error)

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved