Interface MapTypeDecoder

All Superinterfaces:
PrimitiveTypeDecoder<Map>, StreamTypeDecoder<Map>, TypeDecoder<Map>
All Known Implementing Classes:
AbstractMapTypeDecoder, Map32TypeDecoder, Map8TypeDecoder

public interface MapTypeDecoder extends PrimitiveTypeDecoder<Map>
Base interface for all AMQP Map type value decoders.
  • Method Details

    • getTypeClass

      default Class<Map> getTypeClass()
      Specified by:
      getTypeClass in interface StreamTypeDecoder<Map>
      Specified by:
      getTypeClass in interface TypeDecoder<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(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(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