// get message content
Iterator<ContentChunk> cBodies = msg.getContentBodyIterator();
List<Byte> msgContent = new ArrayList<Byte>();
while (cBodies.hasNext())
{
ContentChunk body = cBodies.next();
if (body.getSize() != 0)
{
if (body.getSize() != 0)
{
ByteBuffer slice = body.getData().slice();
for (int j = 0; j < slice.limit(); j++)
{
msgContent.add(slice.get());
}
}