OpenShift Java Client 2.5.0.Final

com.openshift.internal.client.utils
Class StreamUtils

java.lang.Object
  extended by com.openshift.internal.client.utils.StreamUtils

public class StreamUtils
extends Object

Author:
Andre Dietisheim

Constructor Summary
StreamUtils()
           
 
Method Summary
static void close(InputStream inputStream)
           
static void close(OutputStream outputStream)
           
static void close(Reader reader)
           
static void close(Writer writer)
           
static void quietlyClose(InputStream inputStream)
           
static void quietlyClose(OutputStream outputStream)
           
static void quietlyClose(Reader reader)
           
static void quietlyClose(Writer writer)
           
static String readToString(InputStream inputStream)
           
static String readToString(Reader reader)
           
static void writeTo(byte[] data, OutputStream outputStream)
          Writes the given string to the given output stream.
static InputStream writeTo(InputStream inputStream, OutputStream outputStream)
          Writes the content of the given input stream to the given output stream and returns and input stream that may still be used to read from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamUtils

public StreamUtils()
Method Detail

writeTo

public static InputStream writeTo(InputStream inputStream,
                                  OutputStream outputStream)
                           throws IOException
Writes the content of the given input stream to the given output stream and returns and input stream that may still be used to read from.

Parameters:
outputStream - the output stream to write to
inputStream - the input stream to read from
Returns:
a new, unread input stream
Throws:
IOException

readToString

public static String readToString(InputStream inputStream)
                           throws IOException
Throws:
IOException

readToString

public static String readToString(Reader reader)
                           throws IOException
Throws:
IOException

writeTo

public static void writeTo(byte[] data,
                           OutputStream outputStream)
                    throws IOException
Writes the given string to the given output stream. The stream is closed after writing all data.

Parameters:
data - the data to write
outputStream - the stream to write to
Throws:
IOException

close

public static void close(InputStream inputStream)
                  throws IOException
Throws:
IOException

quietlyClose

public static void quietlyClose(InputStream inputStream)

close

public static void close(OutputStream outputStream)
                  throws IOException
Throws:
IOException

quietlyClose

public static void quietlyClose(OutputStream outputStream)

close

public static void close(Reader reader)
                  throws IOException
Throws:
IOException

quietlyClose

public static void quietlyClose(Reader reader)

close

public static void close(Writer writer)
                  throws IOException
Throws:
IOException

quietlyClose

public static void quietlyClose(Writer writer)

OpenShift Java Client 2.5.0.Final

Copyright © 2014 JBoss, a division of Red Hat, Inc.. All Rights Reserved.