@MustImplementEqualsAndHashcode public final class ByteArrayWrapper extends Object implements IHasByteArray, Serializable
IHasByteArray| Constructor and Description |
|---|
ByteArrayWrapper(byte[] aBytes,
boolean bCopyNeeded)
Wrap the whole byte array.
|
ByteArrayWrapper(byte[] aBytes,
int nOfs,
int nLength,
boolean bCopyNeeded)
Wrap the passed byte array or just parts of it.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
bytes() |
boolean |
equals(Object o) |
int |
getOffset() |
int |
hashCode() |
boolean |
isCopy() |
boolean |
isEmpty() |
boolean |
isNotEmpty() |
int |
size() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAllBytes, getHexEncoded, getInputStream, hasOffset, isReadMultiple, startsWith, writeTogetReaderpublic ByteArrayWrapper(@Nonnull byte[] aBytes, boolean bCopyNeeded)
aBytes - The byte array to be wrapped. May not be null.bCopyNeeded - true to copy it, false to reuse the
instance.public ByteArrayWrapper(@Nonnull byte[] aBytes, @Nonnegative int nOfs, @Nonnegative int nLength, boolean bCopyNeeded)
aBytes - The byte array to be wrapped. May not be null.nOfs - Offset. Must be ≥ 0.nLength - Length. Must be ≥ 0.bCopyNeeded - true to copy it, false to reuse the
instance.public boolean isCopy()
isCopy in interface IHasByteArraytrue if the contained byte array was copied in the
constructor or not.@Nonnull @ReturnsMutableObject public byte[] bytes()
bytes in interface IHasByteArraynull.@Nonnegative public int getOffset()
getOffset in interface IHasByteArrayIHasByteArray.bytes(),
IHasSize.size()@Nonnegative public 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()public boolean isNotEmpty()
isNotEmpty in interface IHasByteArrayisNotEmpty in interface IHasSizetrue if at least one item is present,
false if no item is present.IHasSize.size(),
IHasSize.isEmpty()Copyright © 2014–2018 Philip Helger. All rights reserved.