public class IOUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
copy(InputStream in,
OutputStream out)
Copy all available data from one stream to another.
|
static String |
readString(InputStream is)
Read next string from input stream.
|
static String |
readString(InputStream is,
String term)
Read next string from input stream.
|
static String |
readString(Reader is)
Read next string from input stream.
|
static String |
readString(Reader is,
char term)
Read next string from input stream.
|
static String |
readString(Reader is,
String term)
Read next string from input stream.
|
static boolean |
skipUntil(InputStream in,
byte separator)
Skip all bytes in stream until (and including) given byte is found.
|
static boolean |
skipUntil(InputStream in,
byte[] separator)
Skip all bytes in stream until (and including) given separator is found.
|
public static boolean skipUntil(InputStream in, byte[] separator) throws IOException
in
- Input stream to read from.separator
- Separator bytes to skip until.IOException
- if unable to read from stream.public static boolean skipUntil(InputStream in, byte separator) throws IOException
in
- Input stream to read from.separator
- Byte to skip until.IOException
- if unable to read from stream.public static void copy(InputStream in, OutputStream out) throws IOException
in
- The stream to read fromn.out
- The stream to write to.IOException
- If unable to read from or write to streams.public static String readString(InputStream is) throws IOException
is
- The input stream to read.IOException
- when unable to read from stream.public static String readString(InputStream is, String term) throws IOException
is
- The input stream to read.term
- Terminator character.IOException
- when unable to read from stream.public static String readString(Reader is) throws IOException
is
- The input stream to read.IOException
- when unable to read from stream.public static String readString(Reader is, char term) throws IOException
is
- The reader to read characters from.term
- Terminator character.IOException
- when unable to read from stream.public static String readString(Reader is, String term) throws IOException
is
- The reader to read characters from.term
- Terminator character.IOException
- when unable to read from stream.Copyright © 2017. All rights reserved.