Mauron

I/O

Jun 19th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1.                     InputStream uploadedStream = item.getInputStream();
  2.                     OutputStream storableFile;
  3.                     try
  4.                     {
  5.                         storableFile = new FileOutputStream(filesDir + "/" + username + fileExt);
  6. //                      storableFile = new FileOutputStream(filesDir + AVT_DIR + "/" + username + fileExt);
  7.                         byte[] fileBytes = new byte[BUF_SIZE];
  8.                         while (uploadedStream.read(fileBytes) != -1)
  9.                             storableFile.write(fileBytes);
  10.                         uploadedStream.close();
  11.                         storableFile.close();
  12.                         success = true;
  13.                     }
Advertisement
Add Comment
Please, Sign In to add comment