public class StreamTools extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_BUFFER |
| Modifier and Type | Method and Description |
|---|---|
static void |
close(InputStream is) |
static void |
close(IRandomAccess ra) |
static void |
close(OutputStream os) |
static void |
close(RandomAccessFile ra) |
static void |
close(Reader reader) |
static void |
close(Writer writer) |
static void |
copyEncoded(Reader reader,
boolean closeInput,
Writer writer,
boolean closeOutput) |
static void |
copyEncoded(Reader reader,
Writer writer) |
static void |
copyEncodedStream(InputStream source,
String sourceEncoding,
OutputStream destination,
String destinationEncoding) |
static void |
copyStream(InputStream source,
boolean closeInput,
OutputStream destination,
boolean closeOutput)
Kopiert einen Eingabedatenstrom auf einen Ausgabedatenstrom.
|
static void |
copyStream(InputStream source,
OutputStream destination)
Kopiert einen Stream.
|
static byte[] |
getBytes(InputStream is)
The complete content of the
InputStream as a byte array. |
static void |
putBytes(OutputStream os,
byte[] bytes)
Write all bytes to
OutputStream. |
static int |
suggestBufferSize(InputStream is) |
static int |
suggestBufferSize(long totalSize) |
static byte[] |
toByteArray(InputStream is)
The complete content of the
InputStream as a byte array. |
static String |
toString(InputStream is,
String encoding)
The complete content of the
InputStream as a String,
converted using the specified encoding. |
static String |
toString(Reader r)
|
public static final int MAX_BUFFER
public static void close(InputStream is)
public static void close(IRandomAccess ra)
public static void close(OutputStream os)
public static void close(RandomAccessFile ra)
public static void close(Reader reader)
public static void close(Writer writer)
public static void copyEncoded(Reader reader, boolean closeInput, Writer writer, boolean closeOutput) throws IOException
IOExceptionpublic static void copyEncoded(Reader reader, Writer writer) throws IOException
IOExceptionpublic static void copyEncodedStream(InputStream source, String sourceEncoding, OutputStream destination, String destinationEncoding) throws IOException
IOExceptionpublic static void copyStream(InputStream source, boolean closeInput, OutputStream destination, boolean closeOutput) throws IOException
source - EingabedatenstromcloseInput - Angabe ob der InputStream nach dem Kopieren geschlossen werden
soll.destination - AusgabedatenstromcloseOutput - Angabe ob der OutputStream nach dem Kopieren geschlossen
werden soll.IOException - Fehler allgemein oder beim Kopieren.public static void copyStream(InputStream source, OutputStream destination) throws IOException
source - Eingabedatenstrom, der kopiert werden soll.destination - Ausgabestrom, auf den kopiert werden soll.IOExceptioncopyStream(InputStream, boolean, OutputStream, boolean)public static byte[] getBytes(InputStream is) throws IOException
InputStream as a byte array. The
input stream is closed.is - InputStream as a byte array.IOExceptionpublic static void putBytes(OutputStream os, byte[] bytes) throws IOException
OutputStream. The stream is closed.os - bytes - IOExceptionpublic static byte[] toByteArray(InputStream is) throws IOException
InputStream as a byte array. The
input stream is closed.is - InputStream as a byte array.IOExceptionpublic static String toString(InputStream is, String encoding) throws IOException
InputStream as a String,
converted using the specified encoding. If no encoding is specified, the
default encoding is used. The input stream is closed.is - encoding - InputStream as a
StringIOExceptionpublic static String toString(Reader r) throws IOException
r - Reader as a String.IOExceptionpublic static int suggestBufferSize(InputStream is)
public static int suggestBufferSize(long totalSize)
Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.