public static final int MAX_TEXT_SIZE = 1024 * 1024; ... String s = null; try { InputStream is = Connector.openInputStream("resource:///test.txt"); byte[] b = new byte[MAX_TEXT_SIZE]; int i = is.read(b); s = new String(b, 0, i); } catch(Exception e) { // 例外処理 }