}
}
}
for (int k = 0; k < p.getAttachmentList().size(); k++) {
InputStream is = p.getAttachmentList().get((k)).getInputStream();
QuotedPrintableCodec qp = new QuotedPrintableCodec();
// If "is" is not already buffered, wrap a BufferedInputStream
// around it.
if (!(is instanceof BufferedInputStream)) {
is = new BufferedInputStream(is);
}
int c;
StringBuilder sb = new StringBuilder();
System.out.println("Message : ");
while ((c = is.read()) != -1) {
sb.append(c);
System.out.write(c);
}
is.close();
String decoded = qp.decode(sb.toString());
logger.info("decode message is " + decoded);
if (decoded.contains(contains)) {
//found it
messages[i].setFlag(Flags.Flag.DELETED, true);
found++;