public class StreamUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
copyStreamToFile(java.io.InputStream inStream,
java.io.File outFile)
This won't close the stream!!
|
static boolean |
copyStreamToFile(java.io.InputStream inStream,
java.io.File outFile,
boolean append)
This won't close the stream!!
|
static boolean |
copyStreamToStream(java.io.InputStream inStream,
java.io.OutputStream outStream)
This won't close the streams!!
|
static java.lang.String |
copyStreamToString(java.io.InputStream inStream) |
static java.io.File |
copyStreamToTempFile(java.io.InputStream inStream) |
static int |
ensureRead(java.io.InputStream in,
byte[] b,
int off,
int len)
Works similarly to
InputStream but ensures that len is read,
or returns -1 if EOS. |
public static boolean copyStreamToStream(java.io.InputStream inStream,
java.io.OutputStream outStream)
inStream - outStream - public static java.lang.String copyStreamToString(java.io.InputStream inStream)
inStream - public static boolean copyStreamToFile(java.io.InputStream inStream,
java.io.File outFile)
inStream - outFile - public static boolean copyStreamToFile(java.io.InputStream inStream,
java.io.File outFile,
boolean append)
inStream - outFile - append - public static java.io.File copyStreamToTempFile(java.io.InputStream inStream)
inStream - public static int ensureRead(java.io.InputStream in,
byte[] b,
int off,
int len)
throws java.io.IOException
InputStream but ensures that len is read,
or returns -1 if EOS.in - the InputStream to read from.b - the buffer into which the data is read.off - the start offset in array b
at which the data is written.len - the maximum number of bytes to read.b - off - len - -1 if there is no more data because the end of
the stream has been reached.java.io.IOExceptionInputStream}Copyright © 2004-2014 FEUP-LSTS and Neptus developers. All Rights Reserved.