java.io.InputStream into a byte array.
| Modifier and Type | Field and Description |
|---|---|
| private final int | bufferSize
The buffer size for reading from a given stream. |
| public static final StreamDrainer | DEFAULT
A default instance using the |
| public static final int | DEFAULT_BUFFER_SIZE
The default size of the buffer for draining a stream. |
| private static final int | END_OF_STREAM
A convenience constant referring to the value representing the end of a stream. |
| private static final int | FROM_BEGINNING
A convenience constant referring to the value representing the start of a stream. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | StreamDrainer(int
The buffer size for reading from a given stream. bufferSize)Creates a stream drainer with the given buffer size. |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | Returns: A byte array containing the content of the input stream.The input stream to drain. inputStream)Drains an input stream into a byte array. |
| bufferSize | back to summary |
|---|---|
| private final int bufferSize The buffer size for reading from a given stream. | |
| DEFAULT | back to summary |
|---|---|
| public static final StreamDrainer DEFAULT A default instance using the | |
| DEFAULT_BUFFER_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_BUFFER_SIZE The default size of the buffer for draining a stream. | |
| END_OF_STREAM | back to summary |
|---|---|
| private static final int END_OF_STREAM A convenience constant referring to the value representing the end of a stream. | |
| FROM_BEGINNING | back to summary |
|---|---|
| private static final int FROM_BEGINNING A convenience constant referring to the value representing the start of a stream. | |
| StreamDrainer | back to summary |
|---|---|
| public StreamDrainer() Creates a stream drainer with the default buffer size. | |
| StreamDrainer | back to summary |
|---|---|
| public StreamDrainer(int bufferSize) Creates a stream drainer with the given buffer size.
| |
| drain | back to summary |
|---|---|
| public byte[] drain(InputStream inputStream) throws IOException Drains an input stream into a byte array. The given input stream is not closed.
| |