/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * <p> * This function fully implements the quoted-printable encoding specification (rule #1 through rule #5) as * defined in RFC 1521. * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
@Override protected byte[] doDecoding(final byte[] bytes) throws DecoderException { if (bytes == null) { return null; } boolean hasUnderscores = false; for (final byte b : bytes) { if (b == UNDERSCORE) { hasUnderscores = true; break; } } if (hasUnderscores) { final byte[] tmp = new byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { final byte b = bytes[i]; if (b != UNDERSCORE) { tmp[i] = b; } else { tmp[i] = BLANK; } } return QuotedPrintableCodec.decodeQuotedPrintable(tmp); } return QuotedPrintableCodec.decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * * <p> * This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in * RFC 1521. * </p> * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ public byte[] decode(byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
protected byte[] doDecoding(byte[] bytes) throws DecoderException { if (bytes == null) { return null; } boolean hasUnderscores = false; for (int i = 0; i < bytes.length; i++) { if (bytes[i] == UNDERSCORE) { hasUnderscores = true; break; } } if (hasUnderscores) { byte[] tmp = new byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { byte b = bytes[i]; if (b != UNDERSCORE) { tmp[i] = b; } else { tmp[i] = BLANK; } } return QuotedPrintableCodec.decodeQuotedPrintable(tmp); } return QuotedPrintableCodec.decodeQuotedPrintable(bytes); }
@Test public void testDecodeWithNullArray() throws Exception { final byte[] plain = null; final byte[] result = QuotedPrintableCodec.decodeQuotedPrintable( plain ); assertEquals("Result should be null", null, result); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * <p> * This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in * RFC 1521. * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * <p> * This function fully implements the quoted-printable encoding specification (rule #1 through rule #5) as * defined in RFC 1521. * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * * <p> * This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in * RFC 1521. * </p> * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ public byte[] decode(byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * <p> * This function fully implements the quoted-printable encoding specification (rule #1 through rule #5) as * defined in RFC 1521. * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * <p> * This function fully implements the quoted-printable encoding specification (rule #1 through rule #5) as * defined in RFC 1521. * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * <p> * This function fully implements the quoted-printable encoding specification (rule #1 through rule #5) as * defined in RFC 1521. * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * * <p> * This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in * RFC 1521. * </p> * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ public byte[] decode(byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * * <p> * This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in * RFC 1521. * </p> * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ public byte[] decode(byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * * <p> * This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in * RFC 1521. * </p> * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ public byte[] decode(byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
/** * Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted * back to their original representation. * * <p> * This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in * RFC 1521. * </p> * * @param bytes * array of quoted-printable characters * @return array of original bytes * @throws DecoderException * Thrown if quoted-printable decoding is unsuccessful */ public byte[] decode(byte[] bytes) throws DecoderException { return decodeQuotedPrintable(bytes); }
protected byte[] doDecoding(byte[] bytes) throws DecoderException { if (bytes == null) { return null; } boolean hasUnderscores = false; for (int i = 0; i < bytes.length; i++) { if (bytes[i] == UNDERSCORE) { hasUnderscores = true; break; } } if (hasUnderscores) { byte[] tmp = new byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { byte b = bytes[i]; if (b != UNDERSCORE) { tmp[i] = b; } else { tmp[i] = BLANK; } } return QuotedPrintableCodec.decodeQuotedPrintable(tmp); } return QuotedPrintableCodec.decodeQuotedPrintable(bytes); }
protected byte[] doDecoding(byte[] bytes) throws DecoderException { if (bytes == null) { return null; } boolean hasUnderscores = false; for (int i = 0; i < bytes.length; i++) { if (bytes[i] == UNDERSCORE) { hasUnderscores = true; break; } } if (hasUnderscores) { byte[] tmp = new byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { byte b = bytes[i]; if (b != UNDERSCORE) { tmp[i] = b; } else { tmp[i] = BLANK; } } return QuotedPrintableCodec.decodeQuotedPrintable(tmp); } return QuotedPrintableCodec.decodeQuotedPrintable(bytes); }
protected byte[] doDecoding(byte[] bytes) throws DecoderException { if (bytes == null) { return null; } boolean hasUnderscores = false; for (int i = 0; i < bytes.length; i++) { if (bytes[i] == UNDERSCORE) { hasUnderscores = true; break; } } if (hasUnderscores) { byte[] tmp = new byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { byte b = bytes[i]; if (b != UNDERSCORE) { tmp[i] = b; } else { tmp[i] = BLANK; } } return QuotedPrintableCodec.decodeQuotedPrintable(tmp); } return QuotedPrintableCodec.decodeQuotedPrintable(bytes); }
@Override protected byte[] doDecoding(final byte[] bytes) throws DecoderException { if (bytes == null) { return null; } boolean hasUnderscores = false; for (final byte b : bytes) { if (b == UNDERSCORE) { hasUnderscores = true; break; } } if (hasUnderscores) { final byte[] tmp = new byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { final byte b = bytes[i]; if (b != UNDERSCORE) { tmp[i] = b; } else { tmp[i] = BLANK; } } return QuotedPrintableCodec.decodeQuotedPrintable(tmp); } return QuotedPrintableCodec.decodeQuotedPrintable(bytes); }
protected byte[] doDecoding(byte[] bytes) throws DecoderException { if (bytes == null) { return null; } boolean hasUnderscores = false; for (int i = 0; i < bytes.length; i++) { if (bytes[i] == UNDERSCORE) { hasUnderscores = true; break; } } if (hasUnderscores) { byte[] tmp = new byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { byte b = bytes[i]; if (b != UNDERSCORE) { tmp[i] = b; } else { tmp[i] = BLANK; } } return QuotedPrintableCodec.decodeQuotedPrintable(tmp); } return QuotedPrintableCodec.decodeQuotedPrintable(bytes); }