public final class StreamUtil extends Object
| Constructor and Description |
|---|
StreamUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
close(InputStream is) |
static void |
close(Reader is) |
static void |
close(Writer w) |
static int |
pump(InputStream is,
OutputStream os)
Pumps one stream to another, with a buffer - both streams are
closed when the pump is complete.
|
static int |
pump(Reader is,
Writer os)
Pumps one stream to another, with a buffer - both streams are
closed when the pump is complete.
|
static void |
pumpExactly(InputStream is,
OutputStream os,
int bytes) |
static byte[] |
readFully(File f) |
static byte[] |
readFully(InputStream is) |
static String |
readToString(File f) |
static String |
readToString(InputStream is)
Reads all remaining bytes from a stream and returns it
as a string.
|
static String |
readToString(InputStream is,
String encoding)
Reads all remaining bytes from a stream and returns it
as a string.
|
static void |
unbufferedPump(InputStream is,
OutputStream os) |
static void |
write(byte[] b,
File f) |
static void |
write(InputStream is,
File f) |
static void |
write(String s,
File f) |
static void |
write(String s,
Writer w) |
public static final int pump(InputStream is, OutputStream os) throws IOException
IOExceptionpublic static final int pump(Reader is, Writer os) throws IOException
IOExceptionpublic static final void unbufferedPump(InputStream is, OutputStream os) throws IOException
IOExceptionpublic static final void pumpExactly(InputStream is, OutputStream os, int bytes) throws IOException
IOExceptionpublic static String readToString(InputStream is) throws IOException
IOExceptionpublic static String readToString(InputStream is, String encoding) throws IOException
IOExceptionpublic static String readToString(File f) throws IOException
IOExceptionpublic static byte[] readFully(InputStream is) throws IOException
IOExceptionpublic static byte[] readFully(File f) throws IOException
IOExceptionpublic static final void write(String s, Writer w) throws IOException
IOExceptionpublic static final void write(String s, File f) throws IOException
IOExceptionpublic static final void write(byte[] b,
File f)
throws IOException
IOExceptionpublic static final void write(InputStream is, File f) throws IOException
IOExceptionpublic static final void close(InputStream is)
public static final void close(Reader is)
public static final void close(Writer w)
Copyright © 2015. All rights reserved.