|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ebmwebsourcing.easycommons.stream.StreamHelper
public class StreamHelper
| Field Summary | |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
Default value is 2048. |
| Constructor Summary | |
|---|---|
StreamHelper()
|
|
| Method Summary | |
|---|---|
static void |
copy(java.io.InputStream fromStream,
java.io.OutputStream toStream)
Copies information from the input stream to the output stream using a default buffer size of 2048 bytes. |
static void |
copy(java.io.InputStream fromStream,
java.io.OutputStream toStream,
int bufferSize)
Copies information from the input stream to the output stream using the specified buffer size |
static byte[] |
getBytes(java.io.InputStream input)
|
static java.io.ByteArrayInputStream |
getInputStream(java.io.ByteArrayOutputStream outputStream)
Create and return a new ByteArrayInputStream with a buffer array
extracted from the given ByteArrayOutputStream |
static java.lang.String |
getString(java.io.InputStream is)
Return the String representation of an InputStream
NOTE: At the end, the InputStream is closed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_BUFFER_SIZE
| Constructor Detail |
|---|
public StreamHelper()
| Method Detail |
|---|
public static void copy(java.io.InputStream fromStream,
java.io.OutputStream toStream)
fromStream - the InputStream to readtoStream - the OutputStream to write
public static void copy(java.io.InputStream fromStream,
java.io.OutputStream toStream,
int bufferSize)
fromStream - the InputStream to readtoStream - the OutputStream to writebufferSize - size of read blockspublic static byte[] getBytes(java.io.InputStream input)
public static java.io.ByteArrayInputStream getInputStream(java.io.ByteArrayOutputStream outputStream)
ByteArrayInputStream with a buffer array
extracted from the given ByteArrayOutputStream
outputStream - a not null ByteArrayOutputStream
ByteArrayInputStream with a buffer array extracted
from the given ByteArrayOutputStream
public static java.lang.String getString(java.io.InputStream is)
throws java.io.IOException
String representation of an InputStream
NOTE: At the end, the InputStream is closed.
is -
String representation of an
InputStream
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||