title: android studio inputStream form URL problem
body: <p>I'm using this code for bypass the css from WebView loading , I used asset folder for loading my own css but now I need to load my custom css from URL because I need to Change my Css every week .
  probelm is : after change InputStream to URL my css bypass is note working !!<br />
  My old code is :</p>
  <pre><code> private void injectCSS() {
      try {
          InputStream inputStream = getAssets().open(&quot;style.css&quot;);
          byte[] buffer = new byte[inputStream.available()];
          inputStream.read(buffer);
          inputStream.close();
          String encoded = Base64.encodeToString(buffer, Base64.NO_WRAP);
          webView.loadUrl(&quot;javascript:(function() {&quot; +
                  &quot;var parent = document.getElementsByTagName('head').item(0);&quot; +
                  &quot;var style = document.createElement('style');&quot; +
                  &quot;style.type = 'text/css';&quot; +
                  // Tell the browser to BASE64-decode the string into your script !!!
                  &quot;style.innerHTML = window.atob('&quot; + encoded + &quot;');&quot; +
                  &quot;parent.appendChild(style)&quot; +
                  &quot;})()&quot;);
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  <p>and My New code is : &gt; but is not working</p>
  <pre><code>  private void injectCSS() {
      try {
          final InputStream inputStream = new URL(&quot;https://sitemname.ir/app/style.css&quot;).openStream();
          byte[] buffer = new byte[inputStream.available()];
          inputStream.read(buffer);
          inputStream.close();
          String encoded = Base64.encodeToString(buffer, Base64.NO_WRAP);
          webView.loadUrl(&quot;javascript:(function() {&quot; +
                  &quot;var parent = document.getElementsByTagName('head').item(0);&quot; +
                  &quot;var style = document.createElement('style');&quot; +
                  &quot;style.type = 'text/css';&quot; +
                  // Tell the browser to BASE64-decode the string into your script !!!
                  &quot;style.innerHTML = window.atob('&quot; + encoded + &quot;');&quot; +
                  &quot;parent.appendChild(style)&quot; +
                  &quot;})()&quot;);
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>