public class ShortTextLongConverter extends AbstractLongConverter
The ShortTextLongConverter is optimized for encoding text strings of up to 10 characters. It efficiently handles
leading spaces by truncating them, similar to how Base85LongConverter truncates leading zeros. This feature
is particularly useful in scenarios where text padding can be ignored.
This class employs a set of 85 characters, resulting in a more compact representation compared to traditional Base64 encoding, especially for larger data sizes. The custom character set includes a mix of punctuation, numbers, uppercase and lowercase letters, and special characters. This extensive character set ensures a wide range of possible encoded values, enhancing the versatility of the encoding process.
AbstractLongConverter,
Base85LongConverter| Modifier and Type | Field and Description |
|---|---|
static ShortTextLongConverter |
INSTANCE
Provides a readily available instance of ShortTextLongConverter for ease of use.
|
static int |
MAX_LENGTH
Defines the maximum length of text strings that can be parsed by this converter.
|
converter| Modifier and Type | Method and Description |
|---|---|
boolean |
allSafeChars()
Specifies that not all characters are safe for the given
wireOut. |
int |
maxParseLength()
Returns the maximum number of characters that can be parsed.
|
append, append, parse, parseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEncode, allSafeChars, asString, asText, asText, forSymbols, lengthCheck, lengthCheck, maxParseLengthpublic static final int MAX_LENGTH
public static final ShortTextLongConverter INSTANCE
public int maxParseLength()
maxParseLength in interface LongConvertermaxParseLength in class AbstractLongConverterpublic boolean allSafeChars()
wireOut.false, indicating that caution is required as not all characters are safe for all contexts.Copyright © 2024. All rights reserved.