From 7d55699f7bc73cd2ddafac99d7a081de7ba25e2f Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 12 Mar 2022 12:36:18 +0100 Subject: [PATCH] - Changement size long by int --- app/src/main/java/lightcontainer/utils/FileReceiver.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;