标签:ring 内容 except utf-8 round int style cat trace
public static String loadFromAssetsFile(String fname, Resources r) { String result = null; try { InputStream in = r.getAssets().open(fname); int ch = 0; ByteArrayOutputStream baos = new ByteArrayOutputStream(); <span style="background-color: rgb(255, 0, 0);">while ((ch = in.read()) != -1) {//-1表示着色内容的最后一行 baos.write(ch); }</span> System.out.println(ch); byte[] buff = baos.toByteArray(); baos.close(); in.close(); result = new String(buff, "UTF-8"); result = result.replaceAll("\\r\\n", "\n"); } catch (Exception e) { e.printStackTrace(); } return result; }假设红色部分被屏蔽后,会导致载入着色器不成功。
标签:ring 内容 except utf-8 round int style cat trace
原文地址:http://www.cnblogs.com/wzzkaifa/p/7230249.html