Class Utf8Validator

  • All Implemented Interfaces:
    ByteProcessor

    final class Utf8Validator
    extends java.lang.Object
    implements ByteProcessor
    Checks UTF8 bytes for validity
    • Field Detail

      • TYPES

        private static final byte[] TYPES
      • STATES

        private static final byte[] STATES
      • state

        private int state
      • codep

        private int codep
      • checking

        private boolean checking
    • Constructor Detail

      • Utf8Validator

        Utf8Validator()
    • Method Detail

      • check

        public void check​(ByteBuf buffer)
      • check

        void check​(ByteBuf buffer,
                   int index,
                   int length)
      • finish

        public void finish()
      • process

        public boolean process​(byte b)
                        throws java.lang.Exception
        Specified by:
        process in interface ByteProcessor
        Returns:
        true if the processor wants to continue the loop and handle the next byte in the buffer. false if the processor wants to stop handling bytes and abort the loop.
        Throws:
        java.lang.Exception
      • isChecking

        public boolean isChecking()