Code example for ByteArrayInputStream

Methods: availablecloseread

        // 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()];;
    	Uri tmpImageUri = Uri.fromFile(file);
    	return tmpImageUri;
Contextual code suggestions in your IDE  Get Codota for Java