Interface ICharArrayDecoder

  • All Superinterfaces:
    IDecoder<char[],​char[]>
    All Known Subinterfaces:
    ICharArrayCodec, ICharArrayStreamDecoder
    All Known Implementing Classes:
    RFC2616Codec
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ICharArrayDecoder
    extends IDecoder<char[],​char[]>
    Interface for a single decoder for chars.
    Since:
    9.3.6
    Author:
    Philip Helger
    • Method Detail

      • getMaximumDecodedLength

        @Nonnegative
        default int getMaximumDecodedLength​(@Nonnegative
                                            int nEncodedLen)
        Get the maximum decoded length based on the provided encoded length. This is purely for performance reasons.
        Parameters:
        nEncodedLen - The encoded length. Always ≥ 0.
        Returns:
        The maximum decoded length. Always ≥ 0.
      • getDecoded

        @Nullable
        @ReturnsMutableCopy
        default char[] getDecoded​(@Nullable
                                  char[] aEncodedBuffer)
        Decode a char array.
        Specified by:
        getDecoded in interface IDecoder<char[],​char[]>
        Parameters:
        aEncodedBuffer - The char array to be decoded. May be null.
        Returns:
        The decoded char array or null if the parameter was null.
        Throws:
        DecodeException - in case something goes wrong
      • getDecoded

        @Nullable
        @ReturnsMutableCopy
        char[] getDecoded​(@Nullable
                          char[] aEncodedBuffer,
                          @Nonnegative
                          int nOfs,
                          @Nonnegative
                          int nLen)
        Decode a char array.
        Parameters:
        aEncodedBuffer - The char array to be decoded. May be null.
        nOfs - Offset into the char array to start from.
        nLen - Number of chars starting from offset to consider.
        Returns:
        The decoded char array or null if the parameter was null.
        Throws:
        DecodeException - in case something goes wrong