Package javax.microedition.io.file

Examples of javax.microedition.io.file.FileConnection.openInputStream()


          os = hc.openDataOutputStream();
         
          os.write(params.getBytes());
          os.write(startBoundary.getBytes());
         
          is = fc.openInputStream();
                byte[] data = IOUtilities.streamToBytes(is);
                os.write(data);
                is.close();
               
                os.write(endBoundary.getBytes());
View Full Code Here


        final StoredFileInfo result = new StoredFileInfo();
        final FileConnection conn = (FileConnection) Connector.open(rootPrefix + fileName);
        try {
            if (conn.exists()) {
                result.fileLength = conn.fileSize();
                final InputStream in = conn.openInputStream();
                try {
                    final byte[] data = BaseStorage.readFromInputStream(in);
                    result.fileCRC = CRC32.calculate(data);
                } finally {
                    in.close();
View Full Code Here

    public static Image readFile(String fileUrl) throws IOException {
        FileConnection fileConn = (FileConnection) Connector.open(fileUrl, Connector.READ);
        if (!fileConn.exists()) {
            return null;
        }
        return Image.createImage(fileConn.openInputStream());
    }

    public static Image downloadAndSaveImage(String url, final String fileUrl) throws IOException {
        Image result = null;
        // long beforeRequest = System.currentTimeMillis();
View Full Code Here

          newList = new FileList(filename, path, fileList, fc.list());
          fileList.sublists[index] = newList;
          displayFileList(newList);
          return;
        }
        InputStream is = fc.openInputStream();
        int module_len = 0;
        for (;;) {
          int i = is.read(module, module_len, ASAP.MODULE_MAX - module_len);
          if (i <= 0)
            break;
View Full Code Here

            props.append(attrs);

            if (fileName.toLowerCase().endsWith(".sgf"))
                try {
                    StringBuffer sb = new StringBuffer();
                    InputStream is = fc.openInputStream();
                    SGFParser parser = new SGFParser(new InputStreamReader(is));
                    SGFNode head = parser.parseHead();
                    is.close();
                    for (Enumeration e = head.getProperties(); e.hasMoreElements(); ) {
                        sb.append(e.nextElement().toString());
View Full Code Here

        int probCnt = problems.size();

        if (path.endsWith(".sgfi")) {
            FileConnection fc = (FileConnection) Connector.open(
                    "file://localhost/" + path);
            readIndex(path, fc.openInputStream(), false);
        } else {
            rescan |= paths.indexOf(path) < 0;
            if (rescan) {
                removePath(path);
                path = addPath(path);
View Full Code Here

                FileConnection fc = (FileConnection) Connector.open(
                        "file://localhost/" + path);
                if (fc.isDirectory())
                    addDir(path, fc, path);
                else
                    addProblems(path, null, fc.openInputStream(), false);
            }
        }
        return problems.size() - probCnt;
    }
View Full Code Here

            FileConnection fc = (FileConnection) Connector.open(
                    "file://localhost/" + p);
            if (fc.isDirectory())
                addDir(p, fc, topDir);
            else {
                addProblems(p, topDir, fc.openInputStream(), false);
            }
            fc.close();
        }
    }
View Full Code Here

            props.append(attrs);

            if (fileName.toLowerCase().endsWith(".sgf"))
                try {
                    StringBuffer sb = new StringBuffer();
                    InputStream is = fc.openInputStream();
                    InputStreamReader isr = new InputStreamReader(is);
                    SGFParser parser = new SGFParser(isr);
                    SGFNode head = parser.parseHead();
                    is.close();
                    for (Enumeration e = head.getProperties(); e.hasMoreElements(); ) {
View Full Code Here

        int probCnt = problems.size();

        if (path.endsWith(".sgfi")) {
            FileConnection fc = (FileConnection) Connector.open(
                    "file://localhost/" + path);
            readIndex(path, fc.openInputStream(), false);
        } else {
            rescan |= paths.indexOf(path) < 0;
            if (rescan) {
                removePath(path);
                path = addPath(path);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.