public abstract class Streams extends Object
Mainly for use within the framework, but also useful for application code.
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE |
| Constructor and Description |
|---|
Streams() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(byte[] in,
OutputStream out)
Copy the contents of the given byte array to the given OutputStream.
|
static long |
copy(InputStream in,
OutputStream out) |
static long |
copy(InputStream in,
OutputStream out,
byte[] buffer)
Copy the contents of the given InputStream to the given OutputStream.
|
static int |
copy(Reader in,
Writer out)
Copy the contents of the given Reader to the given Writer.
|
static void |
copy(String in,
Writer out)
Copy the contents of the given String to the given output Writer.
|
static String |
copyToString(Reader in)
Copy the contents of the given Reader into a String.
|
static List<String> |
readAllLines(InputStream input) |
static void |
readAllLines(InputStream input,
Callback<String> callback) |
static int |
readFully(InputStream reader,
byte[] dest) |
static int |
readFully(InputStream reader,
byte[] dest,
int offset,
int len) |
static int |
readFully(Reader reader,
char[] dest) |
static int |
readFully(Reader reader,
char[] dest,
int offset,
int len) |
public static final int BUFFER_SIZE
public static long copy(InputStream in, OutputStream out) throws IOException
IOExceptionpublic static long copy(InputStream in, OutputStream out, byte[] buffer) throws IOException
in - the stream to copy fromout - the stream to copy toIOException - in case of I/O errorspublic static void copy(byte[] in,
OutputStream out)
throws IOException
in - the byte array to copy fromout - the OutputStream to copy toIOException - in case of I/O errorspublic static int copy(Reader in, Writer out) throws IOException
in - the Reader to copy fromout - the Writer to copy toIOException - in case of I/O errorspublic static void copy(String in, Writer out) throws IOException
in - the String to copy fromout - the Writer to copy toIOException - in case of I/O errorspublic static String copyToString(Reader in) throws IOException
in - the reader to copy fromIOException - in case of I/O errorspublic static int readFully(Reader reader, char[] dest) throws IOException
IOExceptionpublic static int readFully(Reader reader, char[] dest, int offset, int len) throws IOException
IOExceptionpublic static int readFully(InputStream reader, byte[] dest) throws IOException
IOExceptionpublic static int readFully(InputStream reader, byte[] dest, int offset, int len) throws IOException
IOExceptionpublic static List<String> readAllLines(InputStream input) throws IOException
IOExceptionpublic static void readAllLines(InputStream input, Callback<String> callback) throws IOException
IOExceptionCopyright © 2009–2017. All rights reserved.