Code example for ByteArrayInputStream

Methods: availableread

            // Very simple code to copy a picture from the application's 
            // resource into the external file.  Note that this code does 
            // no error checking, and assumes the picture is small (does not 
            // try to copy it in chunks).  Note that if external storage is 
            // not currently mounted this will silently fail. 
            InputStream is = new ByteArrayInputStream(outdata);
            OutputStream os = new FileOutputStream(file);
            byte[] data = new byte[is.available()];
	    	  // Tell the media scanner about the new file so that it is 
	        // immediately available to the user. 
	                new String[] { file.toString() }, null, 
	                new MediaScannerConnection.OnScanCompletedListener() { 
Connect your IDE to all the code out there  Get Codota for Java