public class StreamUtils extends 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(InputStream first,
InputStream second) |
static String |
convertStreamToString(InputStream in) |
static InputStream |
convertStringToStream(String astring) |
static String |
loadFromURL(String urlReference) |
static void |
pipeInputToOutput(InputStream in,
OutputStream out) |
static byte[] |
readBytesFromStream(InputStream in) |
static String |
readStringFromReader(Reader in) |
static String |
readStringFromReaderDontClose(Reader in) |
public static String convertStreamToString(InputStream in) throws IOException
IOException
public static byte[] readBytesFromStream(InputStream in) throws IOException
IOException
public static void pipeInputToOutput(InputStream in, OutputStream out) throws IOException
IOException
public static boolean areStreamsIdentical(InputStream first, InputStream second) throws IOException
IOException
public static String readStringFromReader(Reader in) throws IOException
IOException
public static String readStringFromReaderDontClose(Reader in) throws IOException
IOException
public static InputStream convertStringToStream(String astring)
public static byte[] append(byte[] source, byte[] addition, int length)
public static char[] append(char[] source, char[] addition, int length)
public static String loadFromURL(String urlReference) throws IOException
IOException
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"