public final class StringSerializer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
StringSerializer.STRING |
| Modifier and Type | Method and Description |
|---|---|
static int |
computeUTF8Size(CharSequence str,
int index,
int len)
Computes the size of the utf8 string beginning at the specified
index with the specified length. |
static char |
highSurrogate(int codePoint) |
static char |
lowSurrogate(int codePoint) |
static LinkedBuffer |
writeAscii(CharSequence str,
WriteSession session,
LinkedBuffer lb)
Writes the ascii bytes from the string into the
LinkedBuffer. |
static LinkedBuffer |
writeDouble(double value,
WriteSession session,
LinkedBuffer lb)
Writes the stringified double into the
LinkedBuffer. |
static LinkedBuffer |
writeFloat(float value,
WriteSession session,
LinkedBuffer lb)
Writes the stringified float into the
LinkedBuffer. |
static LinkedBuffer |
writeInt(int value,
WriteSession session,
LinkedBuffer lb)
Writes the stringified int into the
LinkedBuffer. |
static LinkedBuffer |
writeLong(long value,
WriteSession session,
LinkedBuffer lb)
Writes the stringified long into the
LinkedBuffer. |
static LinkedBuffer |
writeUTF8(CharSequence str,
WriteSession session,
LinkedBuffer lb)
Writes the utf8-encoded bytes from the string into the
LinkedBuffer. |
static LinkedBuffer |
writeUTF8FixedDelimited(CharSequence str,
boolean littleEndian,
WriteSession session,
LinkedBuffer lb)
The length of the utf8 bytes is written first before the string - which is fixed 2-bytes.
|
static LinkedBuffer |
writeUTF8FixedDelimited(CharSequence str,
WriteSession session,
LinkedBuffer lb)
The length of the utf8 bytes is written first (big endian) before the string - which is fixed 2-bytes.
|
static LinkedBuffer |
writeUTF8VarDelimited(CharSequence str,
WriteSession session,
LinkedBuffer lb)
The length of the utf8 bytes is written first before the string - which is a variable int (1 to 5 bytes).
|
public static LinkedBuffer writeInt(int value, WriteSession session, LinkedBuffer lb)
LinkedBuffer.public static LinkedBuffer writeLong(long value, WriteSession session, LinkedBuffer lb)
LinkedBuffer.public static LinkedBuffer writeFloat(float value, WriteSession session, LinkedBuffer lb)
LinkedBuffer. TODO - skip string conversion and write directly to
bufferpublic static LinkedBuffer writeDouble(double value, WriteSession session, LinkedBuffer lb)
LinkedBuffer. TODO - skip string conversion and write directly to
bufferpublic static int computeUTF8Size(CharSequence str, int index, int len)
index with the specified length.public static LinkedBuffer writeUTF8(CharSequence str, WriteSession session, LinkedBuffer lb)
LinkedBuffer.public static LinkedBuffer writeAscii(CharSequence str, WriteSession session, LinkedBuffer lb)
LinkedBuffer. It is the responsibility of the caller to
know in advance that the string is 100% ascii. E.g if you convert a double/float to a string, you are sure it
only contains ascii chars.public static LinkedBuffer writeUTF8FixedDelimited(CharSequence str, WriteSession session, LinkedBuffer lb)
DataOutputStream.writeUTF(String).public static LinkedBuffer writeUTF8FixedDelimited(CharSequence str, boolean littleEndian, WriteSession session, LinkedBuffer lb)
public static LinkedBuffer writeUTF8VarDelimited(CharSequence str, WriteSession session, LinkedBuffer lb)
public static char highSurrogate(int codePoint)
public static char lowSurrogate(int codePoint)
Copyright © 2009–2020. All rights reserved.