Package ej.websocket.util
Class UTF8Validator
- java.lang.Object
-
- ej.websocket.util.UTF8Validator
-
public class UTF8Validator extends Object
Utility class to check the validity of an UTF8 message.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHECK_UTF8_VALIDITY
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisValid(byte[] bytes, int offset, int length)Checks the validity of UTF8 array of bytes.
-
-
-
Field Detail
-
CHECK_UTF8_VALIDITY
public static final String CHECK_UTF8_VALIDITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
isValid
public static boolean isValid(byte[] bytes, int offset, int length)Checks the validity of UTF8 array of bytes.- Parameters:
bytes- the bytes array to check.offset- the offset to start the validity.length- the length to check.- Returns:
- true if the array contains only valid UTF8 code.
-
-