IOUtil class instead.public class CompactChar extends Object
CompactChar utility class provides algorithms for compact
serialization of characters and strings. It uses CESU-8 format
(the format close to UTF-8 but with special handling of surrogate
characters). This is generally the same format as used by standard Java I/O
streams, though Java uses modified CESU-8 (Java represents character
with code 0 using 2-byte encoding, not 1-byte as required).
When encoding character sequences, the CompactChar uses
CompactInt to encode character sequence length first,
then serializes characters themselves. The value -1 for length is used
as a marker to distinguish 'null' sequence from empty sequence.
See CESU-8
for format basics.
Note: this class is deprecated and is replaced by IOUtil class.
See IOUtil class, section UTF APU, and individual methods for documentation.
| Modifier and Type | Method and Description |
|---|---|
static String |
readString(DataInput in)
Deprecated.
Use
IOUtil.readCharArrayString(java.io.DataInput) method instead. |
static void |
writeString(DataOutput out,
String str)
Deprecated.
Use
IOUtil.writeCharArray(DataOutput, String) method instead. |
public static void writeString(DataOutput out, String str) throws IOException
IOUtil.writeCharArray(DataOutput, String) method instead.null string as a valid value.IOExceptionpublic static String readString(DataInput in) throws IOException
IOUtil.readCharArrayString(java.io.DataInput) method instead.null if such value was written to the stream.IOExceptionCopyright © 2002–2025 Devexperts LLC. All rights reserved.