public class ReadableResourceByteArray extends AbstractMemoryReadableResource implements IHasSize
IReadableResource based on a byte array.| Constructor and Description |
|---|
ReadableResourceByteArray(byte[] aBytes) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getAllBytes() |
InputStream |
getInputStream()
Get the input stream to read from the object.
|
String |
getResourceID() |
int |
getSize() |
boolean |
isEmpty() |
String |
toString() |
exists, getAsFile, getAsURL, getPath, getReadableCloneForPathclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisNotEmptygetReaderpublic ReadableResourceByteArray(@Nonnull byte[] aBytes)
@Nonnull @Nonempty public String getResourceID()
getResourceID in interface IResourceBasenull resource ID used e.g. for system IDs in XML
resolving.@Nonnull public InputStream getInputStream()
IHasInputStreamInputStream needs to be created!getInputStream in interface IHasInputStreamnull if resolving failed.@Nonnull @ReturnsMutableCopy public byte[] getAllBytes()
@Nonnegative public int getSize()
public boolean isEmpty()
isEmpty in interface IHasSizetrue if no items are present, false if at
least a single item is present.IHasSize.getSize(),
IHasSize.isNotEmpty()public String toString()
toString in class AbstractMemoryReadableResourceCopyright © 2014–2017 Philip Helger. All rights reserved.