Package org.rypt.f8

Interface Utf8Handler<X extends Exception>

    • Method Detail

      • handleCodePoint

        void handleCodePoint​(int codePoint)
                      throws X extends Exception
        Called when a valid unicode code point is encountered
        Parameters:
        codePoint - the code point that was encountered
        Throws:
        X extends Exception
      • handleError

        void handleError()
                  throws X extends Exception
        Called when an invalid UTF-8 byte sequence is detected
        Throws:
        X extends Exception
      • handle3ByteCodePoint

        default void handle3ByteCodePoint​(int b1,
                                          int b2,
                                          int b3)
                                   throws X extends Exception
        Description copied from interface: Utf8ByteHandler
        Called when a valid 3-byte sequence is encountered.
        Specified by:
        handle3ByteCodePoint in interface Utf8ByteHandler<X extends Exception>
        Parameters:
        b1 - the prefix byte, in the range (byte)0xE0-(byte)0xEF
        b2 - the first continuation byte, in the range (byte)0x80-(byte)0xBF, unless the prefix byte is (byte)0xED or (byte)0xE0, in which case the range is (byte)0x80-(byte)0x9F or (byte)0xA0-(byte)0xBF, respectively
        b3 - the second continuation byte, in the range (byte)0x80-(byte)0xBF
        Throws:
        X extends Exception
        See Also:
        Utf8.codePoint(int, int, int)
      • handle4ByteCodePoint

        default void handle4ByteCodePoint​(int b1,
                                          int b2,
                                          int b3,
                                          int b4)
                                   throws X extends Exception
        Description copied from interface: Utf8ByteHandler
        Called when a valid 4-byte sequence is encountered.
        Specified by:
        handle4ByteCodePoint in interface Utf8ByteHandler<X extends Exception>
        Parameters:
        b1 - the prefix byte, in the range (byte)0xF0-(byte)0xF4
        b2 - the first continuation byte, in the range (byte)0x80-(byte)0xBF, unless the prefix byte is (byte)0xF4 or (byte)0xF0, in which case the range is (byte)0x80-(byte)0x8F or (byte)0x90-(byte)0x9F, respectively
        b3 - the second continuation byte, in the range (byte)0x80-(byte)0xBF
        b4 - the third continuation byte, in the range (byte)0x80-(byte)0xBF
        Throws:
        X extends Exception
        See Also:
        Utf8.codePoint(int, int, int, int)
      • handleContinuationError

        default void handleContinuationError​(int b1,
                                             int b2,
                                             int nextByte)
                                      throws X extends Exception
        Description copied from interface: Utf8ByteHandler
        Called when an invalid continuation byte is encountered in a 3 or 4-byte sequence.
        Specified by:
        handleContinuationError in interface Utf8ByteHandler<X extends Exception>
        Parameters:
        b1 - the prefix byte
        b2 - the first continuation byte
        nextByte - the invalid second continuation byte, or Utf8ByteHandler.END_OF_STREAM to indicate the end of the byte stream
        Throws:
        X extends Exception
      • handleContinuationError

        default void handleContinuationError​(int b1,
                                             int b2,
                                             int b3,
                                             int nextByte)
                                      throws X extends Exception
        Description copied from interface: Utf8ByteHandler
        Called when an invalid continuation byte is encountered in a 4-byte sequence.
        Specified by:
        handleContinuationError in interface Utf8ByteHandler<X extends Exception>
        Parameters:
        b1 - the prefix byte
        b2 - the first continuation byte
        b3 - the second continuation byte
        nextByte - the invalid third continuation byte, or Utf8ByteHandler.END_OF_STREAM to indicate the end of the byte stream
        Throws:
        X extends Exception
      • handlePrefixError

        default void handlePrefixError​(int b1)
                                throws X extends Exception
        Description copied from interface: Utf8ByteHandler
        Called when an invalid prefix byte is encountered.
        Specified by:
        handlePrefixError in interface Utf8ByteHandler<X extends Exception>
        Parameters:
        b1 - the invalid prefix byte, in the range (byte)0x80-(byte)0xC1 or (byte)0xF5-(byte)0xFF
        Throws:
        X extends Exception