FileChannel readableChannel = inputStream.getChannel();
FileChannel writableChannel = outputStream.getChannel();
writableChannel.truncate(0);
writableChannel.transferFrom(
readableChannel, 0, readableChannel.size());
inputStream.close();
outputStream.close();
} catch (IOException ioException) {
String exceptionMessage =