Class Utf8Validator
- java.lang.Object
-
- io.netty.handler.codec.http.websocketx.Utf8Validator
-
- All Implemented Interfaces:
ByteProcessor
final class Utf8Validator extends java.lang.Object implements ByteProcessor
Checks UTF8 bytes for validity
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.util.ByteProcessor
ByteProcessor.IndexNotOfProcessor, ByteProcessor.IndexOfProcessor
-
-
Field Summary
Fields Modifier and Type Field Description private booleancheckingprivate intcodepprivate intstateprivate static byte[]STATESprivate static byte[]TYPESprivate static intUTF8_ACCEPTprivate static intUTF8_REJECT-
Fields inherited from interface io.netty.util.ByteProcessor
FIND_ASCII_SPACE, FIND_COMMA, FIND_CR, FIND_CRLF, FIND_LF, FIND_LINEAR_WHITESPACE, FIND_NON_CR, FIND_NON_CRLF, FIND_NON_LF, FIND_NON_LINEAR_WHITESPACE, FIND_NON_NUL, FIND_NUL, FIND_SEMI_COLON
-
-
Constructor Summary
Constructors Constructor Description Utf8Validator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheck(ByteBuf buffer)voidfinish()booleanisChecking()booleanprocess(byte b)
-
-
-
Field Detail
-
UTF8_ACCEPT
private static final int UTF8_ACCEPT
- See Also:
- Constant Field Values
-
UTF8_REJECT
private static final int UTF8_REJECT
- See Also:
- Constant Field Values
-
TYPES
private static final byte[] TYPES
-
STATES
private static final byte[] STATES
-
state
private int state
-
codep
private int codep
-
checking
private boolean checking
-
-
Method Detail
-
check
public void check(ByteBuf buffer)
-
finish
public void finish()
-
process
public boolean process(byte b) throws java.lang.Exception- Specified by:
processin interfaceByteProcessor- Returns:
trueif the processor wants to continue the loop and handle the next byte in the buffer.falseif the processor wants to stop handling bytes and abort the loop.- Throws:
java.lang.Exception
-
isChecking
public boolean isChecking()
-
-