|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.io.Streams
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class Streams
Provides static utility methods for InputStreams and
OutputStreams.
| Nested Class Summary | |
|---|---|
private static class |
Streams.Buffer
A buffer for I/O. |
private static class |
Streams.InputStreamReaderThreadFactory
A factory for input stream reader threads. |
| Field Summary | |
|---|---|
private static ExecutorService |
executor
|
| Constructor Summary | |
|---|---|
private |
Streams()
You cannot instantiate this class. |
| Method Summary | |
|---|---|
private static Streams.Buffer[] |
allocateBuffers()
|
static void |
cat(InputStream in,
OutputStream out)
Copies the data from the given input stream to the given output stream without closing them. |
static void |
copy(InputStream in,
OutputStream out)
Copies the data from the given input stream to the given output stream and always closes both streams - even if an exception occurs. |
private static void |
releaseBuffers(Streams.Buffer[] buffers)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final ExecutorService executor
| Constructor Detail |
|---|
private Streams()
| Method Detail |
|---|
public static void copy(InputStream in,
OutputStream out)
throws IOException
This is a high performance implementation which uses a pooled background thread to fill a FIFO of data buffers which is concurrently flushed by the current thread.
in - the input stream.out - the output stream.
InputException - if copying the data fails because of an
IOException in the input stream.
IOException - if copying the data fails because of an
IOException in the output stream.
public static void cat(InputStream in,
OutputStream out)
throws IOException
cat because you could use it to concatenate the contents
of multiple streams.
This is a high performance implementation which uses a pooled background thread to fill a FIFO of data buffers which is concurrently flushed by the current thread.
in - the input stream.out - the output stream.
InputException - if copying the data fails because of an
IOException in the input stream.
IOException - if copying the data fails because of an
IOException in the output stream.private static Streams.Buffer[] allocateBuffers()
private static void releaseBuffers(Streams.Buffer[] buffers)
|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||