Package com.helger.commons.codec
Class RFC2616Codec
java.lang.Object
com.helger.commons.codec.RFC2616Codec
- All Implemented Interfaces:
ICharArrayCodec,ICharArrayDecoder,ICharArrayEncoder,ICharArrayStreamDecoder,ICharArrayStreamEncoder,ICodec<char[]>,IDecoder<char[],,char[]> IEncoder<char[],char[]>
Codec for RFC 2616 HTTP header values.
- Since:
- 9.3.6
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDecode (part of) a char array.voidEncode (part of) a char array to anWriter.intgetMaximumDecodedLength(int nEncodedLen) Get the maximum decoded length based on the provided encoded length.intgetMaximumEncodedLength(int nDecodedLen) Get the maximum encoded length based on the provided decoded length.static booleanisMaybeEncoded(char[] s) static booleanstatic booleanisToken(char[] aChars) static booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.commons.codec.ICharArrayDecoder
getDecoded, getDecodedMethods inherited from interface com.helger.commons.codec.ICharArrayStreamDecoder
decode, getDecoded, getDecodedAsString, getDecodedAsString, getDecodedAsStringMethods inherited from interface com.helger.commons.codec.ICharArrayStreamEncoder
encode, getEncoded, getEncoded, getEncoded, getEncodedAsString, getEncodedAsString, getEncodedAsString
-
Constructor Details
-
RFC2616Codec
public RFC2616Codec()
-
-
Method Details
-
isToken
-
isToken
-
isMaybeEncoded
-
isMaybeEncoded
-
getMaximumEncodedLength
Description copied from interface:ICharArrayEncoderGet the maximum encoded length based on the provided decoded length. This is purely for performance reasons. The name of the method would be better called "getMaximumEncodedLength".- Specified by:
getMaximumEncodedLengthin interfaceICharArrayEncoder- Specified by:
getMaximumEncodedLengthin interfaceICharArrayStreamEncoder- Parameters:
nDecodedLen- The decoded length. Always ≥ 0.- Returns:
- The maximum encoded length. Always ≥ 0.
-
encode
public void encode(@Nullable char[] aDecodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose Writer aWriter) Description copied from interface:ICharArrayStreamEncoderEncode (part of) a char array to anWriter.- Specified by:
encodein interfaceICharArrayStreamEncoder- Parameters:
aDecodedBuffer- The char array to be encoded. 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!
-
getMaximumDecodedLength
Description copied from interface:ICharArrayDecoderGet the maximum decoded length based on the provided encoded length. This is purely for performance reasons.- Specified by:
getMaximumDecodedLengthin interfaceICharArrayDecoder- Parameters:
nEncodedLen- The encoded length. Always ≥ 0.- Returns:
- The maximum decoded length. Always ≥ 0.
-
decode
public void decode(@Nullable char[] aEncodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose Writer aWriter) Description copied from interface:ICharArrayStreamDecoderDecode (part of) a char array.- Specified by:
decodein interfaceICharArrayStreamDecoder- 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!
-