@Immutable public class MessageDigestValue extends Object implements com.helger.commons.io.IHasByteArray
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_COPY_NEEDED |
| Constructor and Description |
|---|
MessageDigestValue(EMessageDigestAlgorithm eAlgorithm,
byte[] aDigestBytes) |
MessageDigestValue(EMessageDigestAlgorithm eAlgorithm,
byte[] aDigestBytes,
boolean bIsCopyNeeded) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
bytes() |
static MessageDigestValue |
create(byte[] aBytes,
EMessageDigestAlgorithm eAlgorithm)
Create a new
MessageDigestValue object based on the passed source
byte array |
static MessageDigestValue |
create(InputStream aIS,
EMessageDigestAlgorithm eAlgorithm)
Create a new
MessageDigestValue object based on the passed source
InputStream. |
boolean |
equals(Object o) |
EMessageDigestAlgorithm |
getAlgorithm() |
String |
getHexEncodedDigestString() |
int |
getOffset() |
int |
hashCode() |
boolean |
isCopy() |
int |
size() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAllBytes, getBytesAsString, getHexEncoded, getInputStream, hasOffset, isEmpty, isNotEmpty, isReadMultiple, startsWith, writeTopublic static final boolean DEFAULT_COPY_NEEDED
public MessageDigestValue(@Nonnull EMessageDigestAlgorithm eAlgorithm, @Nonnull @Nonempty byte[] aDigestBytes)
public MessageDigestValue(@Nonnull EMessageDigestAlgorithm eAlgorithm, @Nonnull @Nonempty byte[] aDigestBytes, boolean bIsCopyNeeded)
@Nonnull public EMessageDigestAlgorithm getAlgorithm()
null.public boolean isCopy()
isCopy in interface com.helger.commons.io.IHasByteArray@Nonnull @Nonempty @ReturnsMutableObject public byte[] bytes()
bytes in interface com.helger.commons.io.IHasByteArraynull.@Nonnegative public int size()
size in interface com.helger.commons.lang.IHasSize@Nonnegative public int getOffset()
getOffset in interface com.helger.commons.io.IHasByteArray@Nonnull @Nonempty public String getHexEncodedDigestString()
null.@Nonnull public static MessageDigestValue create(@Nonnull byte[] aBytes, @Nonnull EMessageDigestAlgorithm eAlgorithm)
MessageDigestValue object based on the passed source
byte arrayaBytes - The byte array to create the hash value from. May not be
null.eAlgorithm - The algorithm to be used. May not be null.null.@Nonnull public static MessageDigestValue create(@Nonnull @WillClose InputStream aIS, @Nonnull EMessageDigestAlgorithm eAlgorithm) throws IOException
MessageDigestValue object based on the passed source
InputStream.aIS - The input stream to read from. May not be null.eAlgorithm - The algorithm to be used. May not be null.null.IOException - In case reading throws an IOExceptionCopyright © 2016–2021 Philip Helger. All rights reserved.