public class ReadableResourceByteArray extends AbstractMemoryReadableResource implements IHasSize
IReadableResource based on a byte array.| Constructor and Description |
|---|
ReadableResourceByteArray(byte[] aBytes) |
ReadableResourceByteArray(String sResourceID,
byte[] aBytes) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getAllBytes() |
InputStream |
getInputStream()
Get the input stream to read from the object.
|
boolean |
isEmpty() |
boolean |
isReadMultiple()
Check if the
InputStream from IHasInputStream.getInputStream() can be
acquired more than once. |
int |
size() |
String |
toString() |
exists, getAsFile, getAsURL, getPath, getReadableCloneForPath, getResourceIDclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisNotEmptygetReaderpublic ReadableResourceByteArray(@Nonnull byte[] aBytes)
@Nonnull public final InputStream getInputStream()
IHasInputStreamInputStream needs to be created!getInputStream in interface IHasInputStreamnull if resolving failed.public final boolean isReadMultiple()
IHasInputStreamInputStream from IHasInputStream.getInputStream() can be
acquired more than once.isReadMultiple in interface IHasInputStreamtrue if the input stream can be acquired more than
once, false if not.@Nonnull @ReturnsMutableCopy public final byte[] getAllBytes()
@Nonnegative public final int size()
public final boolean isEmpty()
isEmpty in interface IHasSizetrue if no items are present, false if at
least a single item is present.IHasSize.size(),
IHasSize.isNotEmpty()public String toString()
toString in class AbstractMemoryReadableResourceCopyright © 2014–2017 Philip Helger. All rights reserved.