public class StreamUtils
extends java.lang.Object
Some of the buffer methods here could be rewritten using the ByteArrayOutputStream - this is a JDK class that does a lot of what we want, in a more optimized way than we currently have.
Constructor and Description |
---|
StreamUtils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
append(byte[] source,
byte[] addition,
int length) |
static char[] |
append(char[] source,
char[] addition,
int length) |
static boolean |
areStreamsIdentical(java.io.InputStream first,
java.io.InputStream second) |
static java.lang.String |
convertStreamToString(java.io.InputStream in) |
static java.io.InputStream |
convertStringToStream(java.lang.String astring) |
static java.lang.String |
loadFromURL(java.lang.String urlReference) |
static void |
pipeInputToOutput(java.io.InputStream in,
java.io.OutputStream out) |
static byte[] |
readBytesFromStream(java.io.InputStream in) |
static java.lang.String |
readStringFromReader(java.io.Reader in) |
static java.lang.String |
readStringFromReaderDontClose(java.io.Reader in) |
public static java.lang.String convertStreamToString(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static byte[] readBytesFromStream(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static void pipeInputToOutput(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public static boolean areStreamsIdentical(java.io.InputStream first, java.io.InputStream second) throws java.io.IOException
java.io.IOException
public static java.lang.String readStringFromReader(java.io.Reader in) throws java.io.IOException
java.io.IOException
public static java.lang.String readStringFromReaderDontClose(java.io.Reader in) throws java.io.IOException
java.io.IOException
public static java.io.InputStream convertStringToStream(java.lang.String astring)
public static byte[] append(byte[] source, byte[] addition, int length)
public static char[] append(char[] source, char[] addition, int length)
public static java.lang.String loadFromURL(java.lang.String urlReference) throws java.io.IOException
java.io.IOException
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"