| Modifier and Type | Class and Description |
|---|---|
| public static class | StreamUtils.
A ByteArrayOutputStream which avoids copying of the byte array if possible. |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final byte[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static void | copyStream(InputStream input, OutputStream output)
Allocates a 4096 byte[] for use as a temporary buffer and calls
|
| public static void | copyStream(InputStream input, OutputStream output, int bufferSize)
Allocates a byte[] of the specified size for use as a temporary buffer and calls
|
| public static void | copyStream(InputStream input, OutputStream output, byte[] buffer)
Copy the data from an |
| public static void | copyStream(InputStream input, ByteBuffer output)
Allocates a 4096 byte[] for use as a temporary buffer and calls
|
| public static void | copyStream(InputStream input, ByteBuffer output, int bufferSize)
Allocates a byte[] of the specified size for use as a temporary buffer and calls
|
| public static int | Returns: the number of bytes copied.Must be a direct Buffer with native byte order and the buffer MUST be large enough to hold all the bytes in
the stream. No error checking is performed. output, byte[] buffer)Copy the data from an |
| public static byte[] | |
| public static byte[] | copyStreamToByteArray(InputStream input, int
Used to allocate the output byte[] to possibly avoid an array copy. estimatedSize)Copy the data from an |
| public static String | copyStreamToString(InputStream input)
Calls |
| public static String | copyStreamToString(InputStream input, int estimatedSize)
Calls |
| public static String | copyStreamToString(InputStream input, int
Used to allocate the output buffer to possibly avoid an array copy. estimatedSize, String May be null to use the platform's default charset. charset)Copy the data from an |
| DEFAULT_BUFFER_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_BUFFER_SIZE | |
| EMPTY_BYTES | back to summary |
|---|---|
| public static final byte[] EMPTY_BYTES | |
| StreamUtils | back to summary |
|---|---|
| public StreamUtils() | |
| closeQuietly | back to summary |
|---|---|
| public static void closeQuietly(Closeable c) Close and ignore all errors. | |
| copyStream | back to summary |
|---|---|
| public static void copyStream(InputStream input, OutputStream output) throws IOException Allocates a 4096 byte[] for use as a temporary buffer and calls
| |
| copyStream | back to summary |
|---|---|
| public static void copyStream(InputStream input, OutputStream output, int bufferSize) throws IOException Allocates a byte[] of the specified size for use as a temporary buffer and calls
| |
| copyStream | back to summary |
|---|---|
| public static void copyStream(InputStream input, OutputStream output, byte[] buffer) throws IOException Copy the data from an | |
| copyStream | back to summary |
|---|---|
| public static void copyStream(InputStream input, ByteBuffer output) throws IOException Allocates a 4096 byte[] for use as a temporary buffer and calls
| |
| copyStream | back to summary |
|---|---|
| public static void copyStream(InputStream input, ByteBuffer output, int bufferSize) throws IOException Allocates a byte[] of the specified size for use as a temporary buffer and calls
| |
| copyStream | back to summary |
|---|---|
| public static int copyStream(InputStream input, ByteBuffer output, byte[] buffer) throws IOException Copy the data from an
| |
| copyStreamToByteArray | back to summary |
|---|---|
| public static byte[] copyStreamToByteArray(InputStream input) throws IOException Copy the data from an | |
| copyStreamToByteArray | back to summary |
|---|---|
| public static byte[] copyStreamToByteArray(InputStream input, int estimatedSize) throws IOException Copy the data from an
| |
| copyStreamToString | back to summary |
|---|---|
| public static String copyStreamToString(InputStream input) throws IOException Calls | |
| copyStreamToString | back to summary |
|---|---|
| public static String copyStreamToString(InputStream input, int estimatedSize) throws IOException Calls | |
| copyStreamToString | back to summary |
|---|---|
| public static String copyStreamToString(InputStream input, int estimatedSize, String charset) throws IOException Copy the data from an
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | |
| public synchronized byte[] | toByteArray()
Overrides java. Creates a newly allocated byte array. |
| OptimizedByteArrayOutputStream | back to summary |
|---|---|
| public OptimizedByteArrayOutputStream(int initialSize) | |
| getBuffer | back to summary |
|---|---|
| public byte[] getBuffer() | |
| toByteArray | back to summary |
|---|---|
| public synchronized byte[] toByteArray() Overrides java. Doc from java. Creates a newly allocated byte array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it.
| |