Package com.helger.base.codec
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.
Interface for a single decoder of char, based on reader/writer.
- Since:
- 9.3.6
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionvoidDecode (part of) a char array.default voidDecode a char array.default char @Nullable []getDecoded(char @Nullable [] aEncodedBuffer, int nOfs, int nLen) Decode a char array.default @Nullable StringgetDecodedAsString(char @Nullable [] aEncodedBuffer) Decode a char array and return the result as a String.default @Nullable StringgetDecodedAsString(char @Nullable [] aEncodedBuffer, int nOfs, int nLen) Decode (part of) a char array and return the result as a String.default @Nullable StringgetDecodedAsString(@Nullable String sEncoded) Decode the passed string.Methods inherited from interface com.helger.base.codec.ICharArrayDecoder
getDecoded, getDecoded, getMaximumDecodedLength
-
Method Details
-
decode
Decode a char array.- Parameters:
aEncodedBuffer- The char array to be decoded. May benull.aWriter- The output stream to write to. May not benulland 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 benull.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 benulland 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:
getDecodedin interfaceICharArrayDecoder- 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
-
getDecodedAsString
Decode a char array and return the result as a String.- Parameters:
aEncodedBuffer- The char array to be decoded. May benull.- Returns:
- The decoded string or
nullif the parameter wasnull. - 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 benull.nOfs- Offset into the char array to start from.nLen- Number of chars starting from offset to consider.- Returns:
- The decoded string or
nullif the parameter wasnull. - Throws:
DecodeException- in case something goes wrong
-
getDecodedAsString
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
-