Interface MapTypeDecoder

    • Method Detail

      • getTypeClass

        default java.lang.Class<java.util.Map> getTypeClass()
        Specified by:
        getTypeClass in interface StreamTypeDecoder<java.util.Map>
        Specified by:
        getTypeClass in interface TypeDecoder<java.util.Map>
        Returns:
        the Class that this decoder handles.
      • readSize

        int readSize​(ProtonBuffer buffer)
              throws DecodeException
        Reads the encoded size of the underlying Map type.
        Parameters:
        buffer - The buffer containing the encoded Map type.
        Returns:
        the size in bytes of the encoded Map.
        Throws:
        DecodeException - if an error occurs reading the value
      • readCount

        int readCount​(ProtonBuffer buffer)
               throws DecodeException
        Reads the count of entries in the encoded Map.

        This value is the total count of all key values pairs, and should always be an even number as Map types cannot be unbalanced.

        Parameters:
        buffer - The buffer containing the encoded Map type.
        Returns:
        the number of elements that we encoded from the original Map.
        Throws:
        DecodeException - if an error occurs reading the value
      • readSize

        int readSize​(java.io.InputStream stream)
              throws DecodeException
        Reads the encoded size of the underlying Map type.
        Parameters:
        stream - The InputStream containing the encoded Map type.
        Returns:
        the size in bytes of the encoded Map.
        Throws:
        DecodeException - if an error occurs reading the value
      • readCount

        int readCount​(java.io.InputStream stream)
               throws DecodeException
        Reads the count of entries in the encoded Map.

        This value is the total count of all key values pairs, and should always be an even number as Map types cannot be unbalanced.

        Parameters:
        stream - The InputStream containing the encoded Map type.
        Returns:
        the number of elements that we encoded from the original Map.
        Throws:
        DecodeException - if an error occurs reading the value