Interface ByteConsumer

    • Method Detail

      • consume

        void consume​(ByteCursor cursor)
              throws java.io.IOException
        This method is used to consume bytes from the provided cursor. Consuming of bytes from the cursor should be done in such a way that it does not block. So typically only the number of ready bytes in the ByteCursor object should be read. If there are no ready bytes then this method return.
        Parameters:
        cursor - used to consume the bytes from the cursor
        Throws:
        java.io.IOException
      • isFinished

        boolean isFinished()
        This is used to determine whether the consumer has finished reading. The consumer is considered finished if it has read a terminal token or if it has exhausted the stream and can not read any more. Once finished the consumed bytes can be parsed.
        Returns:
        true if the consumer has finished reading its content