Package com.helger.commons.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[]getDecoded(char[] aEncodedBuffer, int nOfs, int nLen) Decode a char array.default StringgetDecodedAsString(char[] aEncodedBuffer) default StringgetDecodedAsString(char[] aEncodedBuffer, int nOfs, int nLen) default StringgetDecodedAsString(String sEncoded) Decode the passed string.Methods inherited from interface com.helger.commons.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(@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 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
@Nullable @ReturnsMutableCopy default char[] getDecoded(@Nullable char[] 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
-
getDecodedAsString
@Nullable default String getDecodedAsString(@Nullable char[] aEncodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen) -
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
-