title: Load a file from Asset using Xamarin android
body: <p>I want to load a file from the Asset, I found the solution but with Java. How can I convert following Java code  to c#.</p>
  
  <pre><code>public String loadKMLFromAsset() {
  
      String kmlData = null;
      try {
  
          InputStream is = getAssets().open("yourKMLFile");
  
          int size = is.available();
  
          byte[] buffer = new byte[size];
  
          is.read(buffer);
  
          is.close();
  
          kmlData = new String(buffer, "UTF-8");
  
  
      } catch (IOException ex) {
          ex.printStackTrace();
          return null;
      }
      return kmlData;
  
  }
  </code></pre>