es.cesar.quitesleep.utils
Class InputStreamUtils

java.lang.Object
  extended by es.cesar.quitesleep.utils.InputStreamUtils

public class InputStreamUtils
extends java.lang.Object

Author:
Cesar Valiente Gordo

Field Summary
(package private) static int BUFFER_SIZE
           
 
Constructor Summary
InputStreamUtils()
           
 
Method Summary
static java.io.InputStream byteTOInputStream(byte[] in)
          This function converts a byte[] into a InputStream
static java.lang.String byteToString(byte[] in)
          This function converts byte[] into a String
static byte[] InputStreamTOByte(java.io.InputStream in)
           
static java.lang.String InputStreamTOString(java.io.InputStream in)
           
static java.lang.String InputStreamTOString(java.io.InputStream in, java.lang.String encoding)
          This function converts an InputStream in a predefined encoding to a String.
static java.io.InputStream StringTOInputStream(java.lang.String in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

static final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

InputStreamUtils

public InputStreamUtils()
Method Detail

InputStreamTOString

public static java.lang.String InputStreamTOString(java.io.InputStream in)
                                            throws java.lang.Exception
Parameters:
in - InputStream
Returns:
String
Throws:
java.lang.Exception - This function converts an InputStream to a String

InputStreamTOString

public static java.lang.String InputStreamTOString(java.io.InputStream in,
                                                   java.lang.String encoding)
                                            throws java.lang.Exception
This function converts an InputStream in a predefined encoding to a String.

Parameters:
in -
encoding -
Returns:
Throws:
java.lang.Exception

StringTOInputStream

public static java.io.InputStream StringTOInputStream(java.lang.String in)
                                               throws java.lang.Exception
Parameters:
in - String
Returns:
InputStream
Throws:
java.lang.Exception - This function converts a String to a InputStream

InputStreamTOByte

public static byte[] InputStreamTOByte(java.io.InputStream in)
                                throws java.io.IOException
Parameters:
in - InputStream
Returns:
byte[]
Throws:
java.io.IOException - This function converts an InputStream to a byte[]

byteTOInputStream

public static java.io.InputStream byteTOInputStream(byte[] in)
                                             throws java.lang.Exception
This function converts a byte[] into a InputStream

Parameters:
in -
Returns:
Throws:
java.lang.Exception

byteToString

public static java.lang.String byteToString(byte[] in)
                                     throws java.lang.Exception
This function converts byte[] into a String

Parameters:
in -
Returns:
Throws:
java.lang.Exception