public class ByteSource
extends java.lang.Object
| Constructor and Description |
|---|
ByteSource(ByteSource source) |
ByteSource(java.net.URL sourceUrl) |
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
openBufferedStream()
Wrap result
InputStream object into BufferedInputStream object. |
java.io.InputStream |
openStream()
Return new
InputStream object which can be read and closed naturally. |
byte[] |
read()
Read internal byte source and return it as byte array.
|
static ByteSource |
wrap(byte[] source)
Create an instance of the object from given bytes.
|
public ByteSource(@Nonnull
ByteSource source)
public ByteSource(@Nonnull
java.net.URL sourceUrl)
@Nonnull public static ByteSource wrap(@Nonnull byte[] source)
source - bytes to use to create the instance@Nonnull
public java.io.InputStream openStream()
throws java.io.IOException
InputStream object which can be read and closed naturally.java.io.IOException - reading error or null byte source@Nonnull
public java.io.InputStream openBufferedStream()
throws java.io.IOException
InputStream object into BufferedInputStream object.java.io.IOException - reading error or null byte source@Nonnull
public byte[] read()
throws java.io.IOException
java.io.IOException - reading error or null byte source