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 Summary

    Modifier and Type
    Method
    Description
    void
    decode(char @Nullable [] aEncodedBuffer, int nOfs, int nLen, @NonNull Writer aWriter)
    Decode (part of) a char array.
    default void
    decode(char @Nullable [] aEncodedBuffer, @NonNull Writer aWriter)
    Decode a char array.
    default char @Nullable []
    getDecoded(char @Nullable [] aEncodedBuffer, int nOfs, int nLen)
    Decode a char array.
    default @Nullable String
    getDecodedAsString(char @Nullable [] aEncodedBuffer)
    Decode a char array and return the result as a String.
    default @Nullable String
    getDecodedAsString(char @Nullable [] aEncodedBuffer, int nOfs, int nLen)
    Decode (part of) a char array and return the result as a String.
    default @Nullable String
    getDecodedAsString(@Nullable String sEncoded)
    Decode the passed string.

    Methods inherited from interface com.helger.base.codec.ICharArrayDecoder

    getDecoded, getDecoded, getMaximumDecodedLength
  • Method Details

    • decode

      default void decode(char @Nullable [] aEncodedBuffer, @WillNotClose @NonNull 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(char @Nullable [] aEncodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @WillNotClose @NonNull 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

      @ReturnsMutableCopy default char @Nullable [] getDecoded(char @Nullable [] 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

      default @Nullable String getDecodedAsString(char @Nullable [] aEncodedBuffer)
      Decode a char array and return the result as a String.
      Parameters:
      aEncodedBuffer - The char array to be decoded. May be null.
      Returns:
      The decoded string or null if the parameter was null.
      Throws:
      DecodeException - in case something goes wrong
    • getDecodedAsString

      default @Nullable String getDecodedAsString(char @Nullable [] aEncodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen)
      Decode (part of) a char array and return the result as a String.
      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 string or null if the parameter was null.
      Throws:
      DecodeException - in case something goes wrong
    • getDecodedAsString

      default @Nullable 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