TV-Browser 3.3.3 API

util.io.stream
Class StreamUtilities

java.lang.Object
  extended by util.io.stream.StreamUtilities

public class StreamUtilities
extends java.lang.Object

Stream processor class for working with streams This class does all the IOException handling for working with streams, so you can concentrate on your algorithm instead.

Since:
3.0
Author:
Bananeweizen

Nested Class Summary
(package private) static interface StreamUtilities.IInputStreamMethod
           
(package private) static interface StreamUtilities.IOutputStreamMethod
           
 
Constructor Summary
StreamUtilities()
           
 
Method Summary
static void bufferedReader(java.io.File file, BufferedReaderProcessor processor)
           
static void bufferedReader(java.lang.String fileName, BufferedReaderProcessor processor)
           
static void bufferedReaderIgnoringExceptions(java.io.File file, BufferedReaderProcessor processor)
           
static void bufferedWriter(java.io.File file, BufferedWriterProcessor processor)
           
static void bufferedWriterIgnoringExceptions(java.io.File file, BufferedWriterProcessor processor)
           
static void inputStream(java.io.File file, InputStreamProcessor processor)
          Lets you work with a file based input stream.
static void inputStream(java.io.InputStream inputStream, InputStreamProcessor processor)
          Lets you work with a generic input stream.
static void inputStream(java.lang.String fileName, InputStreamProcessor processor)
           
static void inputStream(java.net.URLConnection urlConnection, InputStreamProcessor processor)
          Lets you work with a URL based input stream.
static void inputStream(java.net.URL url, InputStreamProcessor processor)
          Lets you work with a file based input stream.
static void inputStreamIgnoringExceptions(java.io.File file, InputStreamProcessor processor)
           
static void inputStreamIgnoringExceptions(java.lang.String fileName, InputStreamProcessor processor)
          Lets you work with a file name based input stream.
static void objectInputStream(java.io.File file, int bufferSize, ObjectInputStreamProcessor processor)
          Lets you work with a file based input stream.
static void objectInputStream(java.io.File file, ObjectInputStreamProcessor processor)
          Lets you work with a file based input stream.
static void objectInputStreamIgnoringExceptions(java.io.File file, int bufferSize, ObjectInputStreamProcessor processor)
           
static void objectInputStreamIgnoringExceptions(java.io.File file, ObjectInputStreamProcessor processor)
           
static void objectOutputStream(java.io.File file, ObjectOutputStreamProcessor processor)
           
static void objectOutputStreamIgnoringExceptions(java.io.File file, ObjectOutputStreamProcessor processor)
           
static void outputStream(java.io.File file, OutputStreamProcessor processor)
           
static void outputStream(java.lang.String fileName, OutputStreamProcessor processor)
           
static void printStream(java.io.File file, boolean autoFlush, java.lang.String encoding, PrintStreamProcessor processor)
           
static void printStream(java.io.File file, PrintStreamProcessor processor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamUtilities

public StreamUtilities()
Method Detail

inputStream

public static void inputStream(java.io.File file,
                               InputStreamProcessor processor)
                        throws java.io.IOException
Lets you work with a file based input stream. It is guaranteed that the underlying stream is closed, even if IOExceptions occur (which are still thrown further to the caller of this method)

Parameters:
file -
processor -
Throws:
java.io.IOException
Since:
3.0

inputStream

public static void inputStream(java.net.URLConnection urlConnection,
                               InputStreamProcessor processor)
                        throws java.io.IOException
Lets you work with a URL based input stream. It is guaranteed that the underlying stream is closed, even if IOExceptions occur (which are still thrown further to the caller of this method)

Parameters:
urlConnection -
processor -
Throws:
java.io.IOException
Since:
3.0

inputStream

public static void inputStream(java.io.InputStream inputStream,
                               InputStreamProcessor processor)
                        throws java.io.IOException
Lets you work with a generic input stream. It is guaranteed that the stream is closed after the method, even if IOExceptions occur (which are still thrown further to the caller of this method)

Parameters:
inputStream -
processor -
Throws:
java.io.IOException
Since:
3.0

inputStreamIgnoringExceptions

public static void inputStreamIgnoringExceptions(java.lang.String fileName,
                                                 InputStreamProcessor processor)
Lets you work with a file name based input stream. It is guaranteed that the underlying stream is closed, even if IOExceptions occur (which are not thrown)

Parameters:
fileName -
processor -
Since:
3.0

inputStreamIgnoringExceptions

public static void inputStreamIgnoringExceptions(java.io.File file,
                                                 InputStreamProcessor processor)

inputStream

public static void inputStream(java.lang.String fileName,
                               InputStreamProcessor processor)
                        throws java.io.IOException
Throws:
java.io.IOException

inputStream

public static void inputStream(java.net.URL url,
                               InputStreamProcessor processor)
                        throws java.io.IOException
Lets you work with a file based input stream. It is guaranteed that the underlying stream is closed, even if IOExceptions occur (which are still thrown further to the caller of this method)

Parameters:
url - URL to open
processor -
Throws:
java.io.IOException
Since:
3.0

bufferedReader

public static void bufferedReader(java.io.File file,
                                  BufferedReaderProcessor processor)
                           throws java.io.IOException
Throws:
java.io.IOException

bufferedReaderIgnoringExceptions

public static void bufferedReaderIgnoringExceptions(java.io.File file,
                                                    BufferedReaderProcessor processor)

bufferedReader

public static void bufferedReader(java.lang.String fileName,
                                  BufferedReaderProcessor processor)
                           throws java.io.IOException
Throws:
java.io.IOException

outputStream

public static void outputStream(java.io.File file,
                                OutputStreamProcessor processor)
                         throws java.io.IOException
Throws:
java.io.IOException

outputStream

public static void outputStream(java.lang.String fileName,
                                OutputStreamProcessor processor)
                         throws java.io.IOException
Throws:
java.io.IOException

objectOutputStream

public static void objectOutputStream(java.io.File file,
                                      ObjectOutputStreamProcessor processor)
                               throws java.io.IOException
Throws:
java.io.IOException

objectOutputStreamIgnoringExceptions

public static void objectOutputStreamIgnoringExceptions(java.io.File file,
                                                        ObjectOutputStreamProcessor processor)

bufferedWriter

public static void bufferedWriter(java.io.File file,
                                  BufferedWriterProcessor processor)
                           throws java.io.IOException
Throws:
java.io.IOException

bufferedWriterIgnoringExceptions

public static void bufferedWriterIgnoringExceptions(java.io.File file,
                                                    BufferedWriterProcessor processor)

objectInputStream

public static void objectInputStream(java.io.File file,
                                     ObjectInputStreamProcessor processor)
                              throws java.io.IOException
Lets you work with a file based input stream. It is guaranteed that the underlying stream is closed, even if IOExceptions occur (which are still thrown further to the caller of this method)

Parameters:
file -
processor -
Throws:
java.io.IOException
Since:
3.0

objectInputStream

public static void objectInputStream(java.io.File file,
                                     int bufferSize,
                                     ObjectInputStreamProcessor processor)
                              throws java.io.IOException
Lets you work with a file based input stream. It is guaranteed that the underlying stream is closed, even if IOExceptions occur (which are still thrown further to the caller of this method)

Parameters:
file -
processor -
Throws:
java.io.IOException
Since:
3.0

objectInputStreamIgnoringExceptions

public static void objectInputStreamIgnoringExceptions(java.io.File file,
                                                       ObjectInputStreamProcessor processor)

objectInputStreamIgnoringExceptions

public static void objectInputStreamIgnoringExceptions(java.io.File file,
                                                       int bufferSize,
                                                       ObjectInputStreamProcessor processor)

printStream

public static void printStream(java.io.File file,
                               boolean autoFlush,
                               java.lang.String encoding,
                               PrintStreamProcessor processor)
                        throws java.io.IOException
Throws:
java.io.IOException

printStream

public static void printStream(java.io.File file,
                               PrintStreamProcessor processor)
                        throws java.io.IOException
Throws:
java.io.IOException

TV-Browser 3.3.3 API

TV-Browser 3.3.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)