import java.io.*; import javax.microedition.io.*; import javax.microedition.io.file.*; public class Opener{ public String getText(String path){ StringBuffer strBuff = new StringBuffer(); strBuff.append(" ".toCharArray()); InputStream is; //is=getClass().getResourceAsStream(path); try{if(path.startsWith("file:")){ FileConnection currfc = (FileConnection)Connector.open(path); is=currfc.openInputStream();} DataInputStream dis=new DataInputStream(is); int ch = 0; while ((ch = dis.read()) != -1){ strBuff.append((char)(((ch>=0xc0) && (ch<=0xFF)) ? (ch+0x350):ch));}; dis.close();}catch(SecurityException e){strBuff.append("Ôàéë íå íàéäåí!".toCharArray());}catch(Exception ex){strBuff.append((ex.toString()).toCharArray());}; System.gc(); return strBuff.toString(); }; }