Class UpdateDecoderV2

    • Constructor Detail

      • UpdateDecoderV2

        public UpdateDecoderV2​(Decoder decoder)
    • Method Detail

      • readLeftID

        public ID readLeftID()
        Specified by:
        readLeftID in interface UpdateDecoder
        Returns:
        ID with the left client ID and clock
      • readRightID

        public ID readRightID()
        Specified by:
        readRightID in interface UpdateDecoder
        Returns:
        ID with the right client ID and clock
      • readClient

        public int readClient()
        Read the next client ID. Use this in favor of readID whenever possible to reduce the number of objects created.
        Specified by:
        readClient in interface UpdateDecoder
      • readInfo

        public int readInfo()
        Specified by:
        readInfo in interface UpdateDecoder
        Returns:
        info An unsigned 8-bit integer
      • readString

        public java.lang.String readString()
        Specified by:
        readString in interface UpdateDecoder
        Returns:
        the next string
      • readParentInfo

        public boolean readParentInfo()
        Specified by:
        readParentInfo in interface UpdateDecoder
        Returns:
        parent info as a boolean
      • readTypeRef

        public int readTypeRef()
        Specified by:
        readTypeRef in interface UpdateDecoder
        Returns:
        Type reference as an unsigned 8-bit integer
      • readLen

        public int readLen()
        Description copied from interface: UpdateDecoder
        Write len of a struct - well suited for Opt RLE encoder.
        Specified by:
        readLen in interface UpdateDecoder
        Returns:
        length of a struct, well suited for Opt RLE decoder
      • readAny

        public java.lang.Object readAny()
        Specified by:
        readAny in interface UpdateDecoder
        Returns:
        the next "any" value
      • readJSON

        public java.lang.Object readJSON()
        This is mainly here for legacy purposes. Initially, we encoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.
        Specified by:
        readJSON in interface UpdateDecoder
        Returns:
        the next JSON object
      • readKey

        public java.lang.String readKey()
        Specified by:
        readKey in interface UpdateDecoder
        Returns:
        the next key string