Class AbstractPrimitiveTypeDecoder<V>

    • Constructor Detail

      • AbstractPrimitiveTypeDecoder

        public AbstractPrimitiveTypeDecoder()
    • Method Detail

      • isJavaPrimitive

        public boolean isJavaPrimitive()
        Specified by:
        isJavaPrimitive in interface PrimitiveTypeDecoder<V>
        Returns:
        true if the type managed by this decoder is assignable to a Java primitive type.
      • readArrayElements

        public V[] readArrayElements​(ProtonBuffer buffer,
                                     DecoderState state,
                                     int count)
                              throws DecodeException
        Description copied from interface: TypeDecoder
        Reads a series of this type that have been encoded into the body of an Array type.

        When encoded into an array the values are encoded in series following the identifier for the type, this method is given a count of the number of instances that are encoded and should read each in succession and returning them in a new array.

        Specified by:
        readArrayElements in interface TypeDecoder<V>
        Parameters:
        buffer - the source of encoded data.
        state - the current state of the decoder.
        count - the number of array elements encoded in the buffer.
        Returns:
        the next instance in the stream that this decoder handles.
        Throws:
        DecodeException - if an error is encountered while reading the next value.
      • readArrayElements

        public V[] readArrayElements​(InputStream stream,
                                     StreamDecoderState state,
                                     int count)
                              throws DecodeException
        Description copied from interface: StreamTypeDecoder
        Reads a series of this type that have been encoded into the body of an Array type.

        When encoded into an array the values are encoded in series following the identifier for the type, this method is given a count of the number of instances that are encoded and should read each in succession and returning them in a new array.

        Specified by:
        readArrayElements in interface StreamTypeDecoder<V>
        Parameters:
        stream - the source of encoded data.
        state - the current state of the decoder.
        count - the number of array elements encoded in the buffer.
        Returns:
        the next instance in the stream that this decoder handles.
        Throws:
        DecodeException - if an error is encountered while reading the next value.