I see that your using attachment, hence you can directly use the attachment which as getHandler method which returns file stream.
client.type("multipart/mixed").accept("multipart/mixed");
List<Attachment> atts = new LinkedList<Attachment>();
List<Attachment> atts = client.getCollection(atts, Attachment.class);