Record Class MD5
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.util.MD5
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MD5digest(byte[] input) booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.booleanisNil()longleast()Returns the value of theleastrecord component.longmost()Returns the value of themostrecord component.static MD5of(byte[] bytes) static MD5of(long most, long least) static MD5of(FileInfo fileInfo, @Nullable LongConsumer callback) static MD5static MD5of(Path file, @Nullable LongConsumer callback) static MD5byte[]@NotNull StringtoString()Returns a string representation of this record class.voidwrite(ByteOutput data)
-
Field Details
-
NIL
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, MD5> STREAM_CODEC -
DATA_TYPE
-
-
Constructor Details
-
MD5
public MD5(long most, long least) Creates an instance of aMD5record class.- Parameters:
most- the value for themostrecord componentleast- the value for theleastrecord component
-
-
Method Details
-
of
-
of
-
of
-
read
- Throws:
IOException
-
digest
- Throws:
NoSuchAlgorithmException
-
of
- Throws:
IOException
-
of
public static MD5 of(FileInfo fileInfo, @Nullable @Nullable LongConsumer callback) throws IOException - Throws:
IOException
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
isNil
public boolean isNil() -
write
- Throws:
IOException
-
toByteArray
public byte[] toByteArray() -
most
public long most()Returns the value of themostrecord component.- Returns:
- the value of the
mostrecord component
-
least
public long least()Returns the value of theleastrecord component.- Returns:
- the value of the
leastrecord component
-