| java.lang.Object org.apache.commons.fileupload.util.Streams
Streams | final public class Streams (Code) | | Utility class for working with streams.
|
Method Summary | |
public static String | asString(InputStream pStream) This convenience method allows to read a
org.apache.commons.fileupload.FileItemStream 's
content into a string. | public static String | asString(InputStream pStream, String pEncoding) This convenience method allows to read a
org.apache.commons.fileupload.FileItemStream 's
content into a string, using the given character encoding. | public static long | copy(InputStream pInputStream, OutputStream pOutputStream, boolean pClose) Copies the contents of the given
InputStream to the given
OutputStream . | public static long | copy(InputStream pIn, OutputStream pOut, boolean pClose, byte[] pBuffer) Copies the contents of the given
InputStream to the given
OutputStream .
Parameters: pIn - The input stream, which is being read.It is guaranteed, that InputStream.close is calledon the stream. Parameters: pOut - The output stream, to which data shouldbe written. |
copy | public static long copy(InputStream pInputStream, OutputStream pOutputStream, boolean pClose) throws IOException(Code) | | Copies the contents of the given
InputStream to the given
OutputStream . Shortcut for
copy(pInputStream, pOutputStream, new byte[8192]);
Parameters: pInputStream - The input stream, which is being read.It is guaranteed, that InputStream.close is calledon the stream. Parameters: pOutputStream - The output stream, to which data shouldbe written. May be null, in which case the input streamscontents are simply discarded. Parameters: pClose - True guarantees, that OutputStream.closeis called on the stream. False indicates, that onlyOutputStream.flush should be called finally. Number of bytes, which have been copied. throws: IOException - An I/O error occurred. |
copy | public static long copy(InputStream pIn, OutputStream pOut, boolean pClose, byte[] pBuffer) throws IOException(Code) | | Copies the contents of the given
InputStream to the given
OutputStream .
Parameters: pIn - The input stream, which is being read.It is guaranteed, that InputStream.close is calledon the stream. Parameters: pOut - The output stream, to which data shouldbe written. May be null, in which case the input streamscontents are simply discarded. Parameters: pClose - True guarantees, that OutputStream.closeis called on the stream. False indicates, that onlyOutputStream.flush should be called finally. Parameters: pBuffer - Temporary buffer, which is to be used forcopying data. Number of bytes, which have been copied. throws: IOException - An I/O error occurred. |
|
|