public class QuotedPrintableCodec extends AbstractCodec implements IStringCodec
| Constructor and Description |
|---|
QuotedPrintableCodec()
Default constructor with the UTF-8 charset.
|
QuotedPrintableCodec(Charset aCharset)
Constructor which allows for the selection of a default charset
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decode(byte[] aEncodedBuffer)
Decode a byte array.
|
static byte[] |
decodeQuotedPrintable(byte[] aEncodedBuffer) |
String |
decodeText(String sEncoded)
Decode the passed string.
|
static String |
decodeText(String sEncoded,
Charset aCharset) |
byte[] |
encode(byte[] aDecodedBuffer)
Encode a byte array.
|
static byte[] |
encodeQuotedPrintable(BitSet aPrintableBitSet,
byte[] aDecodedBuffer) |
static void |
encodeQuotedPrintable(int b,
NonBlockingByteArrayOutputStream aBAOS)
Encodes byte into its quoted-printable representation.
|
String |
encodeText(BitSet aBitSet,
String sDecoded) |
static String |
encodeText(BitSet aPrintableBitSet,
String sDecoded,
Charset aCharset)
Encode the passed text using a custom BitSet
|
String |
encodeText(String sDecoded)
Encode the passed string.
|
static String |
encodeText(String sDecoded,
Charset aCharset)
Encode the passed text using the default BitSet.
|
Charset |
getCharset()
Gets the default charset name used for string decoding and encoding.
|
static BitSet |
getDefaultBitSet() |
decode, encodepublic QuotedPrintableCodec()
@Nonnull public Charset getCharset()
IStringCodecgetCharset in interface IStringCodecnull.@Nonnull @ReturnsMutableCopy public static BitSet getDefaultBitSet()
public static final void encodeQuotedPrintable(int b,
@Nonnull
NonBlockingByteArrayOutputStream aBAOS)
b - byte to encodeaBAOS - the buffer to write to@Nonnull public static byte[] encodeQuotedPrintable(@Nonnull BitSet aPrintableBitSet, @Nonnull byte[] aDecodedBuffer)
@Nullable public byte[] encode(@Nullable byte[] aDecodedBuffer)
IByteArrayEncoderencode in interface IByteArrayEncoderencode in interface IEncoder<byte[]>aDecodedBuffer - The byte array to be encoded. May be null.null if the parameter was
null.@Nullable public static byte[] decodeQuotedPrintable(@Nullable byte[] aEncodedBuffer)
@Nullable public byte[] decode(@Nullable byte[] aEncodedBuffer)
IByteArrayDecoderdecode in interface IByteArrayDecoderdecode in interface IDecoder<byte[]>aEncodedBuffer - The byte array to be decoded. May not be null.null if the parameter was
null.@Nullable public String encodeText(@Nullable String sDecoded)
IStringCodecencodeText in interface IStringCodecsDecoded - The string to be encoded. May be null.null if the input string is null.@Nullable public static String encodeText(@Nullable String sDecoded, @Nonnull Charset aCharset)
sDecoded - The original string to be encoded. May be null.aCharset - The charset to be used. May not be null.null
if the original string is null.@Nullable public static String encodeText(@Nonnull BitSet aPrintableBitSet, @Nullable String sDecoded, @Nonnull Charset aCharset)
aPrintableBitSet - The BitSet with all chars to NOT escape. May not be
null.sDecoded - The original string to be encoded. May be null.aCharset - The charset to be used. May not be null.null
if the original string is null.@Nullable public String decodeText(@Nullable String sEncoded)
IStringCodecdecodeText in interface IStringCodecsEncoded - The string to be decoded. May be null.null if the input string is null.Copyright © 2006–2015 phloc systems. All rights reserved.