public class StreamUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE
Default size of buffer for working with streams.
|
Constructor and Description |
---|
StreamUtils() |
Modifier and Type | Method and Description |
---|---|
static long |
copy(java.io.InputStream pIn,
Copies the contents of the given
InputStream to the given OutputStream and closes streams. |
static long |
copy(java.io.InputStream pIn,
Copies the contents of the given
InputStream to the given OutputStream . |
static java.lang.String |
getContentFromReader(java.io.Reader aReader)
Converts whole Reader content into String
|
static java.lang.String |
getContentFromStream(java.io.InputStream pStream)
* This convenience method allows to read an InputStream's content into a string.
|
static void |
XMLStreamReaderCloseQuietly(javax.xml.stream.XMLStreamReader xsr)
Try to close XMLStreamReader.
|
aReader
- Reader to read fromjava.io.IOException
pStream
- The input stream to read.java.io.IOException
- An I/O error occurred.InputStream
to the given OutputStream
and closes streams.pIn
- The input stream, which is being read. It is guaranteed, that InputStream.close()
is called on the stream.pOut
- The output stream, to which data should be written. May be null, in which case the input streams contents are simply
discarded.java.io.IOException
- An I/O error occurred.InputStream
to the given OutputStream
.pIn
- The input stream, which is being read. It is guaranteed, that InputStream.close()
is called on the stream.pOut
- The output stream, to which data should be written. May be null, in which case the input streams contents are simply
discarded.pClose
- True guarantees, that OutputStream.close()
is called on the stream. False indicates, that only
OutputStream.flush()
should be called finally.pBuffer
- Temporary buffer, which is to be used for copying data.java.io.IOException
- An I/O error occurred.xsr
- XMLStreamReader which should be closed.