Interface ICharArrayStreamDecoder

  • All Superinterfaces:
    ICharArrayDecoder, IDecoder<char[],​char[]>
    All Known Subinterfaces:
    ICharArrayCodec
    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 ICharArrayStreamDecoder
    extends ICharArrayDecoder
    Interface for a single decoder of char, based on reader/writer.
    Since:
    9.3.6
    Author:
    Philip Helger
    • Method Detail

      • decode

        default void decode​(@Nullable
                            char[] aEncodedBuffer,
                            @Nonnull @WillNotClose
                            Writer aWriter)
        Decode a char array.
        Parameters:
        aEncodedBuffer - The char array to be decoded. May be null.
        aWriter - The output stream to write to. May not be null and is NOT closed afterwards!
        Throws:
        DecodeException - in case something goes wrong
        Since:
        9.0.0
      • decode

        void decode​(@Nullable
                    char[] aEncodedBuffer,
                    @Nonnegative
                    int nOfs,
                    @Nonnegative
                    int nLen,
                    @Nonnull @WillNotClose
                    Writer aWriter)
        Decode (part of) 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.
        aWriter - The writer to write to. May not be null and is NOT closed afterwards!
        Throws:
        DecodeException - in case something goes wrong
      • getDecoded

        @Nullable
        @ReturnsMutableCopy
        default char[] getDecoded​(@Nullable
                                  char[] aEncodedBuffer,
                                  @Nonnegative
                                  int nOfs,
                                  @Nonnegative
                                  int nLen)
        Decode a char array.
        Specified by:
        getDecoded in interface ICharArrayDecoder
        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
      • getDecodedAsString

        @Nullable
        default String getDecodedAsString​(@Nullable
                                          String sEncoded)
        Decode the passed string.
        Parameters:
        sEncoded - The string to be decoded. May be null.
        Returns:
        null if the input string is null.
        Throws:
        DecodeException - in case something goes wrong