org.ow2.dragon.util
Class InputStreamUtil

java.lang.Object
  extended by org.ow2.dragon.util.InputStreamUtil

public class InputStreamUtil
extends java.lang.Object

Author:
ofabre - eBM Websourcing

Field Summary
static int DEFAULT_BUFFER_SIZE
          Default value is 2048.
 
Constructor Summary
InputStreamUtil()
           
 
Method Summary
static void copy(java.io.InputStream input, java.io.OutputStream output)
          Copies information from the input stream to the output stream using a default buffer size of 2048 bytes.
static void copy(java.io.InputStream input, java.io.OutputStream output, int bufferSize)
          Copies information from the input stream to the output stream using the specified buffer size
static void copyThenClose(java.io.InputStream input, java.io.OutputStream output)
          Copies information between specified streams and then closes both of the streams.
static byte[] getBytes(java.io.InputStream input)
           
static java.io.InputStream getInputStream(java.lang.String resourceLocation)
           
static java.io.InputStream getInputStream(java.net.URI resourceLocation)
           
static java.io.InputStream getInputStream(java.net.URL resourceLocation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
Default value is 2048.

See Also:
Constant Field Values
Constructor Detail

InputStreamUtil

public InputStreamUtil()
Method Detail

getInputStream

public static java.io.InputStream getInputStream(java.lang.String resourceLocation)
                                          throws java.io.IOException,
                                                 java.net.URISyntaxException
Throws:
java.io.IOException
java.net.URISyntaxException

getInputStream

public static java.io.InputStream getInputStream(java.net.URI resourceLocation)
                                          throws java.io.IOException,
                                                 java.net.URISyntaxException
Throws:
java.io.IOException
java.net.URISyntaxException

getInputStream

public static java.io.InputStream getInputStream(java.net.URL resourceLocation)
                                          throws java.io.IOException,
                                                 java.net.URISyntaxException
Throws:
java.io.IOException
java.net.URISyntaxException

copy

public static void copy(java.io.InputStream input,
                        java.io.OutputStream output)
                 throws java.io.IOException
Copies information from the input stream to the output stream using a default buffer size of 2048 bytes.

Throws:
java.io.IOException

copy

public static void copy(java.io.InputStream input,
                        java.io.OutputStream output,
                        int bufferSize)
                 throws java.io.IOException
Copies information from the input stream to the output stream using the specified buffer size

Throws:
java.io.IOException

copyThenClose

public static void copyThenClose(java.io.InputStream input,
                                 java.io.OutputStream output)
                          throws java.io.IOException
Copies information between specified streams and then closes both of the streams.

Throws:
java.io.IOException

getBytes

public static byte[] getBytes(java.io.InputStream input)
                       throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.