Package net.minecraft.util
Record Class PngInfo
java.lang.Object
java.lang.Record
net.minecraft.util.PngInfo
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
The field for theheight
record component.private static final int
private static final int
private static final long
private final int
The field for thewidth
record component. -
Constructor Summary
ConstructorDescriptionPngInfo
(int width, int height) Creates an instance of aPngInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static PngInfo
fromBytes
(byte[] p_301719_) static PngInfo
fromStream
(InputStream p_301756_) final int
hashCode()
Returns a hash code value for this object.int
height()
Returns the value of theheight
record component.final String
toString()
Returns a string representation of this record class.int
width()
Returns the value of thewidth
record component.
-
Field Details
-
width
private final int widthThe field for thewidth
record component. -
height
private final int heightThe field for theheight
record component. -
PNG_HEADER
private static final long PNG_HEADER- See Also:
-
IHDR_TYPE
private static final int IHDR_TYPE- See Also:
-
IHDR_SIZE
private static final int IHDR_SIZE- See Also:
-
-
Constructor Details
-
PngInfo
public PngInfo(int width, int height) Creates an instance of aPngInfo
record class.- Parameters:
width
- the value for thewidth
record componentheight
- the value for theheight
record component
-
-
Method Details
-
fromStream
- Throws:
IOException
-
fromBytes
- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
width
public int width()Returns the value of thewidth
record component.- Returns:
- the value of the
width
record component
-
height
public int height()Returns the value of theheight
record component.- Returns:
- the value of the
height
record component
-