final int length = fileInput.read(buffer);
final byte[] key = new byte[length];
System.arraycopy(buffer, 0, key, 0, length);
return key;
} catch (final IOException e) {
throw new NoSqlStoreException("Failed to read in encryption file: " + file.getAbsolutePath(), e);
}
} else {
throw new NoSqlStoreException("Cannot find encryption file: " + file.getAbsolutePath());
}
}