int len;
try {
while ((len = in.read(buffer)) >= 0)
out.write(buffer, 0, len);
} catch (IOException e) {
throw new SynapseCommonsException("Error during converting a input stream " +
"into a byte array", e, log);
} finally {
if (in != null) {
try {
in.close();