Package com.helger.commons.codec
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.
Interface for a single decoder for chars.
- Since:
- 9.3.6
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault char[]getDecoded(char[] aEncodedBuffer) Decode a char array.char[]getDecoded(char[] aEncodedBuffer, int nOfs, int nLen) Decode a char array.default char[]getDecoded(String sEncoded) Decode the passed string.default intgetMaximumDecodedLength(int nEncodedLen) Get the maximum decoded length based on the provided encoded length.
-
Method Details
-
getMaximumDecodedLength
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
Decode a char array.- Specified by:
getDecodedin interfaceIDecoder<char[],char[]> - Parameters:
aEncodedBuffer- The char array to be decoded. May benull.- Returns:
- The decoded char array or
nullif the parameter wasnull. - 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 benull.nOfs- Offset into the char array to start from.nLen- Number of chars starting from offset to consider.- Returns:
- The decoded char array or
nullif the parameter wasnull. - Throws:
DecodeException- in case something goes wrong
-
getDecoded
Decode the passed string.- Parameters:
sEncoded- The string to be decoded. May benull.- Returns:
nullif the input string isnull.- Throws:
DecodeException- in case something goes wrong
-