Class GuacamoleParser

    • Field Detail

      • INSTRUCTION_MAX_LENGTH

        public static final int INSTRUCTION_MAX_LENGTH
        The maximum number of characters per instruction.
        See Also:
        Constant Field Values
      • INSTRUCTION_MAX_DIGITS

        public static final int INSTRUCTION_MAX_DIGITS
        The maximum number of digits to allow per length prefix.
        See Also:
        Constant Field Values
      • INSTRUCTION_MAX_ELEMENTS

        public static final int INSTRUCTION_MAX_ELEMENTS
        The maximum number of elements per instruction, including the opcode.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GuacamoleParser

        public GuacamoleParser()
    • Method Detail

      • append

        public int append​(char[] chunk,
                          int offset,
                          int length)
                   throws GuacamoleException
        Appends data from the given buffer to the current instruction.
        Parameters:
        chunk - The buffer containing the data to append.
        offset - The offset within the buffer where the data begins.
        length - The length of the data to append.
        Returns:
        The number of characters appended, or 0 if complete instructions have already been parsed and must be read via next() before more data can be appended.
        Throws:
        GuacamoleException - If an error occurs while parsing the new data.
      • append

        public int append​(char[] chunk)
                   throws GuacamoleException
        Appends data from the given buffer to the current instruction.
        Parameters:
        chunk - The data to append.
        Returns:
        The number of characters appended, or 0 if complete instructions have already been parsed and must be read via next() before more data can be appended.
        Throws:
        GuacamoleException - If an error occurs while parsing the new data.