- Changement size long by int
This commit is contained in:
parent
5fe63fa3ea
commit
7d55699f7b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user