Class Charsetfunctions
java.lang.Object
org.java_websocket.util.Charsetfunctions
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final CodingErrorActionprivate static final int[]Implementation of the "Flexible and Economical UTF-8 Decoder" algorithm by Björn Höhrmann (http://bjoern.hoehrmann.de/utf-8/decoder/dfa/) -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor for real static class -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]asciiBytes(String s) static booleanisValidUTF8(ByteBuffer data) Calling isValidUTF8 with offset 0static booleanisValidUTF8(ByteBuffer data, int off) Check if the provided BytebBuffer contains a valid utf8 encoded string.static StringstringAscii(byte[] bytes) static StringstringAscii(byte[] bytes, int offset, int length) static StringstringUtf8(byte[] bytes) static StringstringUtf8(ByteBuffer bytes) static byte[]
-
Field Details
-
codingErrorAction
-
utf8d
private static final int[] utf8dImplementation of the "Flexible and Economical UTF-8 Decoder" algorithm by Björn Höhrmann (http://bjoern.hoehrmann.de/utf-8/decoder/dfa/)
-
-
Constructor Details
-
Charsetfunctions
private Charsetfunctions()Private constructor for real static class
-
-
Method Details
-
utf8Bytes
-
asciiBytes
-
stringAscii
-
stringAscii
-
stringUtf8
- Throws:
InvalidDataException
-
stringUtf8
- Throws:
InvalidDataException
-
isValidUTF8
Check if the provided BytebBuffer contains a valid utf8 encoded string.Using the algorithm "Flexible and Economical UTF-8 Decoder" by Björn Höhrmann (http://bjoern.hoehrmann.de/utf-8/decoder/dfa/)
- Parameters:
data- the ByteBufferoff- offset (for performance reasons)- Returns:
- does the ByteBuffer contain a valid utf8 encoded string
-
isValidUTF8
Calling isValidUTF8 with offset 0- Parameters:
data- the ByteBuffer- Returns:
- does the ByteBuffer contain a valid utf8 encoded string
-