public class StreamHelper extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
BUFFERSIZE |
static int |
DEFAULT_CHUNK_SIZE |
| 构造器和说明 |
|---|
StreamHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static long |
copy(InputStream inputStream,
OutputStream outputStream)
input->output字节流copy
|
static long |
copy(InputStream inputStream,
OutputStream outputStream,
int bufferSize)
input->output字节流copy
|
static long |
copy(Reader reader,
Writer writer) |
static long |
copy(Reader reader,
Writer writer,
int bufferSize) |
static InputStream |
getStreamFromClasspath(String resourceName) |
static InputStream |
getStreamFromFile(File file) |
static InputStream |
getStreamFromString(String text) |
static InputStream |
getStreamFromUrl(URL url) |
static InputStream |
openStream(String resource)
根据文件名称resource打开输入流,并返回
|
static byte[] |
readBytes(InputStream in) |
static long |
transfer(InputStream in,
OutputStream out) |
public static final int DEFAULT_CHUNK_SIZE
public static final int BUFFERSIZE
public static InputStream openStream(String resource)
resource - public static InputStream getStreamFromString(String text)
public static InputStream getStreamFromFile(File file)
public static InputStream getStreamFromClasspath(String resourceName)
public static InputStream getStreamFromUrl(URL url)
public static byte[] readBytes(InputStream in) throws IOException
IOExceptionpublic static long transfer(InputStream in, OutputStream out) throws IOException
IOExceptionpublic static long copy(InputStream inputStream, OutputStream outputStream) throws IOException
inputStream - outputStream - IOExceptionpublic static long copy(InputStream inputStream, OutputStream outputStream, int bufferSize) throws IOException
inputStream - outputStream - bufferSize - IOExceptionpublic static long copy(Reader reader, Writer writer) throws IOException
IOExceptionpublic static long copy(Reader reader, Writer writer, int bufferSize) throws IOException
IOExceptionCopyright © 2013-2015. All Rights Reserved.