public class ReadableResourceByteArray extends AbstractMemoryReadableResource implements IHasByteArray
IReadableResource based on a byte array.| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_COPY_NEEDED |
| Constructor and Description |
|---|
ReadableResourceByteArray(byte[] aBytes) |
ReadableResourceByteArray(byte[] aBytes,
boolean bCopyNeeded) |
ReadableResourceByteArray(byte[] aBytes,
int nOfs,
int nLen) |
ReadableResourceByteArray(byte[] aBytes,
int nOfs,
int nLen,
boolean bCopyNeeded) |
ReadableResourceByteArray(String sResourceID,
byte[] aBytes) |
ReadableResourceByteArray(String sResourceID,
byte[] aBytes,
boolean bCopyNeeded) |
ReadableResourceByteArray(String sResourceID,
byte[] aBytes,
int nOfs,
int nLen) |
ReadableResourceByteArray(String sResourceID,
byte[] aBytes,
int nOfs,
int nLen,
boolean bCopyNeeded) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
bytes() |
InputStream |
getInputStream()
Get the input stream to read from the object.
|
int |
getOffset() |
boolean |
isCopy() |
boolean |
isEmpty() |
boolean |
isReadMultiple()
Check if the
InputStream from IHasInputStream.getInputStream() and
IHasInputStream.getBufferedInputStream() can be acquired more than once. |
int |
size() |
String |
toString() |
exists, getAsFile, getAsURL, getPath, getReadableCloneForPath, getResourceIDclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAllBytes, getHexEncoded, hasOffset, isNotEmpty, startsWith, writeTogetBufferedReader, getReadergetBufferedInputStreampublic static final boolean DEFAULT_COPY_NEEDED
public ReadableResourceByteArray(@Nonnull byte[] aBytes)
public ReadableResourceByteArray(@Nonnull byte[] aBytes, @Nonnegative int nOfs, @Nonnegative int nLen)
public ReadableResourceByteArray(@Nonnull byte[] aBytes, boolean bCopyNeeded)
public ReadableResourceByteArray(@Nonnull byte[] aBytes, @Nonnegative int nOfs, @Nonnegative int nLen, boolean bCopyNeeded)
public ReadableResourceByteArray(@Nullable String sResourceID, @Nonnull byte[] aBytes)
public ReadableResourceByteArray(@Nullable String sResourceID, @Nonnull byte[] aBytes, @Nonnegative int nOfs, @Nonnegative int nLen)
public ReadableResourceByteArray(@Nullable String sResourceID, @Nonnull byte[] aBytes, boolean bCopyNeeded)
public ReadableResourceByteArray(@Nullable String sResourceID, @Nonnull byte[] aBytes, @Nonnegative int nOfs, @Nonnegative int nLen, boolean bCopyNeeded)
public final boolean isCopy()
isCopy in interface IHasByteArraytrue if the contained byte array was copied in the
constructor or not.@Nonnull @ReturnsMutableObject public final byte[] bytes()
bytes in interface IHasByteArraynull.@Nonnegative public int getOffset()
getOffset in interface IHasByteArrayIHasByteArray.bytes(),
IHasSize.size()@Nonnegative public final int size()
public boolean isEmpty()
isEmpty in interface IHasByteArrayisEmpty in interface IHasSizetrue if no items are present, false if at
least a single item is present.IHasSize.size(),
IHasSize.isNotEmpty()@Nonnull public InputStream getInputStream()
IHasInputStreamInputStream needs to be created.getInputStream in interface IHasByteArraygetInputStream in interface IHasInputStreamnull if resolving failed.public boolean isReadMultiple()
IHasInputStreamInputStream from IHasInputStream.getInputStream() and
IHasInputStream.getBufferedInputStream() can be acquired more than once.isReadMultiple in interface IHasByteArrayisReadMultiple in interface IHasInputStreamtrue if the input stream can be acquired more than
once, false if not.public String toString()
toString in class AbstractMemoryReadableResourceCopyright © 2014–2019 Philip Helger. All rights reserved.