public class ByteArrayInputStreamProvider extends Object implements IHasInputStreamAndReader, Serializable
InputStream provider based on a byte array.| Constructor and Description |
|---|
ByteArrayInputStreamProvider(byte[] aData) |
ByteArrayInputStreamProvider(byte[] aData,
int nOfs,
int nLen) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getData() |
InputStream |
getInputStream()
Get the input stream to read from the object.
|
int |
getLength() |
int |
getOffset() |
Reader |
getReader(Charset aCharset)
Get an
Reader based on this input stream provider using the given
charset. |
String |
toString() |
public ByteArrayInputStreamProvider(@Nonnull byte[] aData)
public ByteArrayInputStreamProvider(@Nonnull byte[] aData, @Nonnegative int nOfs, @Nonnegative int nLen)
@Nonnull @ReturnsMutableCopy public byte[] getData()
@Nonnegative public int getOffset()
@Nonnegative public int getLength()
@Nonnull public final InputStream getInputStream()
IHasInputStreamInputStream needs to be created!getInputStream in interface IHasInputStreamnull if resolving failed.@Nonnull public final Reader getReader(@Nonnull Charset aCharset)
IHasInputStreamAndReaderReader based on this input stream provider using the given
charset.getReader in interface IHasInputStreamAndReaderaCharset - The charset to use. May not be null.null if no input stream could be retrieved.Copyright © 2014–2015 Philip Helger. All rights reserved.