@Test public void testEncodeQuotedPrintableLargeInput() throws Exception { StringBuilder sb = new StringBuilder(); for (int i = 0; i < 1024 * 5; i++) { sb.append((char) ('0' + (i % 10))); } String expected = sb.toString().replaceAll("(\\d{75})", "$1=\r\n"); InputStream in = InputStreams.createAscii(sb.toString()); ByteArrayOutputStream out = new ByteArrayOutputStream(); EncoderUtil.encodeQBinary(in, out); String actual = ContentUtil.toAsciiString(out.toByteArray()); Assert.assertEquals(expected, actual); }
public static void encodeQBinary(final InputStream in, final OutputStream out) throws IOException { QuotedPrintableOutputStream qpOut = new QuotedPrintableOutputStream(out, true); ContentUtil.copy(in, qpOut); qpOut.close(); }
EncoderUtil { public static void encodeQBinary(final InputStream in, final OutputStream out) throws IOException { QuotedPrintableOutputStream qpOut = new QuotedPrintableOutputStream(out, true); ContentUtil.copy(in, qpOut); qpOut.close(); } }
EncoderUtil { public static void encodeQBinary(final InputStream in, final OutputStream out) throws IOException { QuotedPrintableOutputStream qpOut = new QuotedPrintableOutputStream(out, true); ContentUtil.copy(in, qpOut); qpOut.close(); } private  EncoderUtil(); }
EncoderUtil { public static void encodeQBinary(final InputStream in, final OutputStream out) throws IOException { QuotedPrintableOutputStream qpOut = new QuotedPrintableOutputStream(out, true); ContentUtil.copy(in, qpOut); qpOut.close(); } private  EncoderUtil(); static String encodeAddressDisplayName(String displayName); static String encodeAddressLocalPart(String localPart); static String encodeHeaderParameter(String name, String value); static String encodeIfNecessary(String text, Usage usage,
            int usedCharacters); static boolean hasToBeEncoded(String text, int usedCharacters); static String encodeEncodedWord(String text, Usage usage); static String encodeEncodedWord(String text, Usage usage,
            int usedCharacters); static String encodeEncodedWord(String text, Usage usage,
            int usedCharacters, Charset charset, Encoding encoding); static String encodeB(byte[] bytes); static String encodeQ(byte[] bytes, Usage usage); static void encodeQBinary(final InputStream in, final OutputStream out); static void encodeQ(final InputStream in, final OutputStream out); static void encodeB(final InputStream in, final OutputStream out); static boolean isToken(String str); }
EncoderUtil { public static void encodeQBinary(final InputStream in, final OutputStream out) throws IOException { QuotedPrintableOutputStream qpOut = new QuotedPrintableOutputStream(out, true); ContentUtil.copy(in, qpOut); qpOut.close(); } private  EncoderUtil(); static String encodeAddressDisplayName(String displayName); static String encodeAddressLocalPart(String localPart); static String encodeHeaderParameter(String name, String value); static String encodeIfNecessary(String text, Usage usage,
            int usedCharacters); static boolean hasToBeEncoded(String text, int usedCharacters); static String encodeEncodedWord(String text, Usage usage); static String encodeEncodedWord(String text, Usage usage,
            int usedCharacters); static String encodeEncodedWord(String text, Usage usage,
            int usedCharacters, Charset charset, Encoding encoding); static String encodeB(byte[] bytes); static String encodeQ(byte[] bytes, Usage usage); static void encodeQBinary(final InputStream in, final OutputStream out); static void encodeQ(final InputStream in, final OutputStream out); static void encodeB(final InputStream in, final OutputStream out); static boolean isToken(String str);  }