Code example for FileInputStream

Methods: closeread

0
 
   File attachment = new File("/sdcard/Sounds/" + fileName);
   if (attachment.exists()) {
       FileInputStream fis;
       try { 
           fis = new FileInputStream(attachment);
           byte[] bytes = new byte[(int) attachment.length()];
           try { 
               fis.read(bytes);
               fis.close();
 
               attachment.delete();
 
               saveMedia("Test" + fileName, bytes);
 
           } catch (IOException e) {
               // TODO Auto-generated catch block 
               e.printStackTrace();
           } 
 
Connect your IDE to all the code out there  Get Codota for Java