public abstract class StringEncoder extends Object
| Modifier and Type | Field and Description |
|---|---|
static StringEncoder |
DEFAULT
Default instance.
|
static StringEncoder |
SQUASH_TO_ASCII
Writes one byte per code point; non-ASCII code points are represented
by a replacement character.
|
| Modifier | Constructor and Description |
|---|---|
protected |
StringEncoder(String name)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract int |
copyToBytes(String txt,
byte[] buf)
Encodes the given string into an existing byte array.
|
abstract byte[] |
toBytes(String txt)
Encodes the given string into a new byte array.
|
String |
toString() |
public static final StringEncoder SQUASH_TO_ASCII
public static final StringEncoder DEFAULT
protected StringEncoder(String name)
name - encoder namepublic abstract byte[] toBytes(String txt)
txt - string to encode, not nullpublic abstract int copyToBytes(String txt, byte[] buf)
txt - string to encode, not nullbuf - buffer to receive encoded textCopyright © 2026 Central Laboratory of the Research Councils. All Rights Reserved.