Constructor and Description |
---|
IOUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
copy(InputStream is,
OutputStream os)
Copies all data from the given input stream to the given output stream
and closes the streams.
|
static void |
copy(InputStream is,
OutputStream os,
boolean close)
Copies all data from the given input stream to the given output stream.
|
static void |
copy(Reader r,
Writer w)
Copies all text from the given reader to the given writer and closes
both afterwards.
|
static void |
copy(Reader r,
Writer w,
boolean close)
Copies all text from the given reader to the given writer.
|
static void |
skip(InputStream is)
Skips the content of the stream as long as there is data available.
|
public IOUtil()
public static void skip(InputStream is) throws IOException
is
- the input stream.IOException
- if an I/O error occurs.public static void copy(InputStream is, OutputStream os, boolean close) throws IOException
is
- the input stream.os
- the output stream.close
- true
if both streams are closed afterwards,
false
otherwise.IOException
- if an I/O error occurs.public static void copy(InputStream is, OutputStream os) throws IOException
copy(is, os, true)
.is
- the input stream.os
- the output stream.IOException
- if an I/O error occurs.copy(InputStream, OutputStream, boolean)
public static void copy(Reader r, Writer w, boolean close) throws IOException
r
- the reader.w
- the writer.close
- true
if both reader and writer are closed
afterwards, false
otherwise.IOException
- if an I/O error occurs.public static void copy(Reader r, Writer w) throws IOException
copy(r, w, true)
.r
- the reader.w
- the writer.IOException
- if an I/O error occurs.copy(Reader, Writer, boolean)
Copyright © 2015. All Rights Reserved.