public final class InputStreamExtensions extends Object
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
asUtf8ByteStream(String string) |
static int |
copyTo(InputStream extendee,
OutputStream output)
Copy bytes from an
InputStream to an
OutputStream. |
public static int copyTo(InputStream extendee, OutputStream output) throws IOException
InputStream to an
OutputStream.
This method buffers the input internally, so there is no need to use a
BufferedInputStream.
extendee - the InputStream to read fromoutput - the OutputStream to write toIllegalArgumentException - if the input or output is nullIOException - if an I/O error occurspublic static InputStream asUtf8ByteStream(String string) throws UnsupportedEncodingException
UnsupportedEncodingExceptionCopyright © 2010–2014 The Apache Software Foundation. All rights reserved.