com.ebmwebsourcing.easycommons.stream
Class StreamHelper
java.lang.Object
com.ebmwebsourcing.easycommons.stream.StreamHelper
public class StreamHelper
- extends java.lang.Object
- Author:
- ofabre
|
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.lang.String |
getString(java.io.InputStream is)
Return the String representation of an InputStream |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
- Default value is 2048.
- See Also:
- Constant Field Values
StreamHelper
public StreamHelper()
copy
public 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.
- Parameters:
fromStream - the InputStream to readtoStream - the OutputStream to write
copy
public 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
- Parameters:
fromStream - the InputStream to readtoStream - the OutputStream to writebufferSize - size of read blocks
getBytes
public static byte[] getBytes(java.io.InputStream input)
getString
public static java.lang.String getString(java.io.InputStream is)
throws java.io.IOException
- Return the
String representation of an InputStream
NOTE: At the end, the InputStream is closed.
- Parameters:
is -
- Returns:
- Return the
String representation of an
InputStream
- Throws:
java.io.IOException
Copyright © 2011 Petals Link. All Rights Reserved.