Package com.ranull.graves.util
Class Base64Util
java.lang.Object
com.ranull.graves.util.Base64Util
Utility class for serializing and deserializing objects to and from Base64 strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Objectbase64ToObject(String string) Deserializes a Base64 encoded string back to an object.static URLextractSkinURL(String base64) Extracts the skin URL from a Minecraft texture Base64 string.static StringobjectToBase64(Object object) Serializes an object to a Base64 encoded string.
-
Method Details
-
objectToBase64
Serializes an object to a Base64 encoded string.- Parameters:
object- The object to serialize.- Returns:
- The Base64 encoded string representing the serialized object, or null if an error occurs.
-
base64ToObject
Deserializes a Base64 encoded string back to an object.- Parameters:
string- The Base64 encoded string to deserialize.- Returns:
- The deserialized object, or null if an error occurs.
-
extractSkinURL
Extracts the skin URL from a Minecraft texture Base64 string.- Parameters:
base64- The Base64-encoded texture string from PlayerProfile.- Returns:
- The skin URL as a URL object, or null if it cannot be extracted.
-