com.openshift.internal.client.utils
Class StreamUtils
java.lang.Object
com.openshift.internal.client.utils.StreamUtils
public class StreamUtils
- extends Object
- Author:
- Andre Dietisheim
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamUtils
public StreamUtils()
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 toinputStream
- 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 writeoutputStream
- 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)
Copyright © 2014 JBoss, a division of Red Hat, Inc.. All Rights Reserved.