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