My application is receiving email through SMTP server. There are one or more attachments in the email and email attachment return as byte[] (using sun javamail api).
ByteArrayInputStream bais = new ByteArrayInputStream(retByte); ZipInputStream zis = new ZipInputStream(bais); zis.getNextEntry(); Scanner sc = new Scanner(zis); while (sc.hasNextLine()) { System.out.println("-->:" +sc.nextLine()); } zis.closeEntry(); zis.close();