public final class InputStreamByteSource extends Object implements ByteSource
EMPTY_BYTES
Constructor and Description |
---|
InputStreamByteSource(InputStream input, int bufsize)
Create a new ByteSource backed by a InputStream.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
asBytes() |
InputStream |
asStream() |
String |
asString(Charset charset) |
public InputStreamByteSource(InputStream input, int bufsize)
input
- InputStream
bufsize
- Size of the buffer used when consuming the InputStream
public byte[] asBytes()
asBytes
in interface
ByteSource
public InputStream asStream()
asStream
in interface
ByteSource
public String asString(Charset charset)
asString
in interface
ByteSource
charset
- Charset