Module org.tquadrat.foundation.util
Class ByteArrayStringConverter
java.lang.Object
org.tquadrat.foundation.util.stringconverter.ByteArrayStringConverter
- All Implemented Interfaces:
Serializable,StringConverter<byte[]>
@ClassVersion(sourceVersion="$Id: ByteArrayStringConverter.java 1045 2023-02-07 23:09:17Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public final class ByteArrayStringConverter
extends Object
implements StringConverter<byte[]>
The implementation of
StringConverter
for byte arrays.
The output from
toString(byte[])
will be in BASE64 format, encoded to
ASCII.
Correspondingly,
fromString(CharSequence)
expects an ASCII encoded BASE64 stream.
Both methods are using the BASE64 basic encoding scheme.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: ByteArrayStringConverter.java 1045 2023-02-07 23:09:17Z tquadrat $
- Since:
- 0.1.0
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.util.stringconverter.ByteArrayStringConverter"
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ByteArrayStringConverterAn instance of this class.Fields inherited from interface org.tquadrat.foundation.lang.StringConverter
METHOD_NAME_GetSubjectClass, METHOD_NAME_Provider -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofByteArrayStringConverter. -
Method Summary
Modifier and TypeMethodDescriptionfinal byte[]fromString(CharSequence source) final Collection<Class<?>> Provides the subject class for this converter.static final ByteArrayStringConverterprovider()This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.final StringtoString(byte[] source)
-
Field Details
-
INSTANCE
An instance of this class.
-
-
Constructor Details
-
ByteArrayStringConverter
public ByteArrayStringConverter()Creates a new instance ofByteArrayStringConverter.
-
-
Method Details
-
fromString
- Specified by:
fromStringin interfaceStringConverter<byte[]>- Throws:
IllegalArgumentException
-
provider
This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.- Returns:
- The instance for this
StringConverterimplementation.
-
getSubjectClass
Provides the subject class for this converter.- Returns:
- The subject class.
-
toString
- Specified by:
toStringin interfaceStringConverter<byte[]>
-
