diff --git a/app/src/main/java/lightcontainer/utils/FileReceiver.java b/app/src/main/java/lightcontainer/utils/FileReceiver.java index 07f5a3f..e513857 100644 --- a/app/src/main/java/lightcontainer/utils/FileReceiver.java +++ b/app/src/main/java/lightcontainer/utils/FileReceiver.java @@ -12,19 +12,19 @@ public class FileReceiver { public FileReceiver(String path) { this.path = path; } - public boolean receiveFile(InputStream input, String fileName, long fileSize, String key, String iv) { + public boolean receiveFile(InputStream input, String fileName, int fileSize, String key, String iv) { int bytesReceived = 0; BufferedOutputStream bosFile = null; try { bosFile = new BufferedOutputStream(new FileOutputStream(String.format("%s/%s", path, fileName))); - //AES_GCM.encryptStream(input, bosFile, fileSize, key, iv); + AES_GCM.encryptStream(input, bosFile, fileSize, key, iv); bosFile.flush(); bosFile.close(); return true; - } catch(IOException ex) { + } catch(IOException | AES_GCM.AesGcmException ex) { ex.printStackTrace(); if(bosFile != null) { try { bosFile.close(); } catch(Exception e) {} } return false;