at.molindo.utils.io
Class StreamUtils

java.lang.Object
  extended by at.molindo.utils.io.StreamUtils

public class StreamUtils
extends Object


Method Summary
static byte[] bytes(InputStream in)
           
static byte[] bytes(InputStream in, int bufferSize)
          get bytes from InputStream
static void close(Closeable... in)
           
static void close(Closeable in)
           
static void close(Iterable<Closeable> iterable)
           
static OutputStream compress(OutputStream out, Compression compression)
           
static int copy(InputStream in, OutputStream out)
           
static int copy(InputStream in, OutputStream out, int bufferSize)
           
static InputStream decompress(InputStream in, Compression compression)
           
static boolean equals(InputStream i1, InputStream i2)
           
static boolean equals(InputStream i1, InputStream i2, int buf)
           
static void readFully(InputStream in, byte[] b)
           
static void readFully(InputStream in, byte[] b, int off, int len)
           
static String string(InputStream in)
           
static String string(InputStream in, Charset charset)
           
static String string(InputStream in, Charset charset, int bufferSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

string

public static String string(InputStream in)
                     throws IOException
Throws:
IOException

string

public static String string(InputStream in,
                            Charset charset)
                     throws IOException
Throws:
IOException

string

public static String string(InputStream in,
                            Charset charset,
                            int bufferSize)
                     throws IOException
Throws:
IOException

copy

public static int copy(InputStream in,
                       OutputStream out)
                throws IOException
Throws:
IOException

copy

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

decompress

public static InputStream decompress(InputStream in,
                                     Compression compression)
                              throws IOException
Parameters:
in -
compression -
Returns:
Throws:
IOException
IllegalArgumentException - if compression none of Compression.BZIP2, Compression.GZIP, Compression.NONE

compress

public static OutputStream compress(OutputStream out,
                                    Compression compression)
                             throws IOException
Throws:
IOException

close

public static void close(Closeable... in)

close

public static void close(Iterable<Closeable> iterable)

close

public static void close(Closeable in)

bytes

public static byte[] bytes(InputStream in)
                    throws IOException
Throws:
IOException

bytes

public static byte[] bytes(InputStream in,
                           int bufferSize)
                    throws IOException
get bytes from InputStream

Parameters:
in -
bufferSize -
Returns:
Throws:
IOException

readFully

public static void readFully(InputStream in,
                             byte[] b)
                      throws EOFException,
                             IOException
Throws:
EOFException
IOException

readFully

public static void readFully(InputStream in,
                             byte[] b,
                             int off,
                             int len)
                      throws EOFException,
                             IOException
Throws:
EOFException
IOException

equals

public static boolean equals(InputStream i1,
                             InputStream i2)
                      throws IOException
Throws:
IOException

equals

public static boolean equals(InputStream i1,
                             InputStream i2,
                             int buf)
                      throws IOException
Throws:
IOException


Copyright © 2011 Molindo GmbH. All Rights Reserved.