|
Carrot2 v3.5.2
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.util.StreamUtils
public final class StreamUtils
A set of common helper methods used with input streams and file objects.
| Field Summary | |
|---|---|
static Writer |
NULL_WRITER
A dummy writer with empty implementations of Writer methods. |
| Method Summary | |
|---|---|
static void |
copy(InputStream in,
OutputStream out,
int bufSize)
Copies all available data from the input stream to the output stream. |
static void |
copyAndClose(InputStream in,
OutputStream out,
int bufSize)
Copies all available data from the input stream to the output stream. |
static InputStream |
prefetch(InputStream stream)
Prefetch the entire content of stream, close it and return
an InputStream to an in-memory ByteArrayInputStream. |
static byte[] |
readFully(InputStream input)
Read the contents of an opened stream until EOF (or an exception is thrown). |
static char[] |
readFully(Reader input)
Read the contents of an opened reader until EOF (or an exception is thrown). |
static byte[] |
readFullyAndClose(InputStream input)
Read the contents of an opened stream until EOF (or an exception is thrown). |
static char[] |
readFullyAndClose(Reader input)
Read the contents of an opened Reader until EOF (or an exception is thrown). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Writer NULL_WRITER
Writer methods.
| Method Detail |
|---|
public static byte[] readFullyAndClose(InputStream input)
throws IOException
input - Input stream to be read.
IOException - propagated from the underlying stream.
public static byte[] readFully(InputStream input)
throws IOException
input - InputStream from which data is to be read.
IOException - propagated from the underlying stream.
public static char[] readFullyAndClose(Reader input)
throws IOException
input - Reader to be read.
IOException - propagated from the underlying stream.
public static char[] readFully(Reader input)
throws IOException
input - Reader from which data will be read.
IOException - propagated from the underlying stream.
public static InputStream prefetch(InputStream stream)
throws IOException
stream, close it and return
an InputStream to an in-memory ByteArrayInputStream. If
stream is already a ByteArrayInputStream, it is
returned immediately.
IOException
public static void copy(InputStream in,
OutputStream out,
int bufSize)
throws IOException
IOException
public static void copyAndClose(InputStream in,
OutputStream out,
int bufSize)
throws IOException
IOException
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||