public abstract class StreamUtils extends Object
Constructor and Description |
---|
StreamUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
compareCharStreams(InputStream s1,
InputStream s2)
Compares the 2 streams.
|
static boolean |
compareCharStreams(Reader s1,
Reader s2)
Compares the 2 streams.
|
static boolean |
compareCharStreams(String s1,
String s2)
Compares the 2 streams.
|
static String |
normalizeLines(Reader charStream,
boolean trim) |
static String |
normalizeLines(String string,
boolean trim) |
static byte[] |
readFile(File file)
Deprecated.
|
static byte[] |
readStream(InputStream stream)
Read the supplied InputStream and return as a byte array.
|
static String |
readStream(Reader stream) |
static String |
readStreamAsString(InputStream stream)
Read the supplied InputStream and return as a byte array.
|
static StringBuffer |
trimLines(InputStream charStream) |
static StringBuffer |
trimLines(Reader charStream) |
static String |
trimLines(String charStream) |
static void |
writeFile(File file,
byte[] data) |
public static byte[] readStream(InputStream stream) throws IOException
stream
- The stream to read.IOException
- Exception reading from the stream.public static String readStreamAsString(InputStream stream) throws IOException
stream
- The stream to read.IOException
- Exception reading from the stream.public static byte[] readFile(File file) throws IOException
FileUtils.readFile(java.io.File)
.file
- The file to read.IOException
- Error readiong file.public static void writeFile(File file, byte[] data) throws IOException
IOException
public static String readStream(Reader stream) throws IOException
IOException
public static boolean compareCharStreams(InputStream s1, InputStream s2)
trimLines(InputStream)
on each stream before comparing.s1
- Stream 1.s2
- Stream 2.public static boolean compareCharStreams(Reader s1, Reader s2)
trimLines(java.io.Reader)
on each stream before comparing.s1
- Stream 1.s2
- Stream 2.public static boolean compareCharStreams(String s1, String s2)
trimLines(java.io.Reader)
on each stream before comparing.s1
- Stream 1.s2
- Stream 2.public static StringBuffer trimLines(Reader charStream) throws IOException
IOException
public static String normalizeLines(String string, boolean trim) throws IOException
IOException
public static String normalizeLines(Reader charStream, boolean trim) throws IOException
IOException
public static StringBuffer trimLines(InputStream charStream) throws IOException
IOException
public static String trimLines(String charStream) throws IOException
IOException
Copyright © 2015. All rights reserved.