Package java.io

Examples of java.io.RandomAccessFile.readLine()


      for (String fileName : fileNameList)
         fileNameMap.put(fileName, fileName);

      String fName;
      while ((fName = raf.readLine()) != null)
         if (fName.startsWith(PREFIX_REMOVED_DATA) == false)
         {
            File f = new File(fName);

            if (fileNameMap.containsKey(f.getName()))
View Full Code Here


      int res = 0;
      boolean _found = false;
      RandomAccessFile raf = new RandomAccessFile(_path  + "users.log", "rw");

      try {
        String _userData = raf.readLine();
        while (_userData != null && !_found) {
          StringTokenizer line = new StringTokenizer(_userData);
          while (line.hasMoreTokens()) {
            _field = line.nextToken();
            if (_field.contains("nextID:")) {
View Full Code Here

              //System.out.print(aux);
              raf.writeBytes(aux);
              _found = true;
            }
          }
          _userData = raf.readLine();
        }
                raf.close();
      } catch (Exception e) {
      }
      return res;
View Full Code Here

      RandomAccessFile raf = new RandomAccessFile(metaDataFile, "rw");

      String fileName;

      while ((fileName = raf.readLine()) != null)
         if (fileName.indexOf(identifier) != -1)
         {
            raf.seek(raf.getFilePointer() - (fileName.length() + 1));

            String s = new String(fileName);
View Full Code Here

      for (String fileName : fileNameList)
         fileNameMap.put(fileName, fileName);

      String fName;
      while ((fName = raf.readLine()) != null)
         if (fName.startsWith(PREFIX_REMOVED_DATA) == false)
         {
            File f = new File(fName);

            if (fileNameMap.containsKey(f.getName()))
View Full Code Here

        tail.append("\n-------------------- "+tag+"---------------------\n");
        String[] lines = null;
        if (num >0) {
          lines = new String[num];
        }
        while ((line = rafile.readLine()) != null) {
          no_lines++;
          if (num >0) {
            if (no_lines <= num) {
              lines[no_lines-1] = line;
            }
View Full Code Here

        throw new RuntimeException("Missing components for key " + key +
            " in directory " + componentDir.getAbsolutePath());
      }
      File metaFile = new File(componentDir,key + ".meta");
      RandomAccessFile raFile = new RandomAccessFile(metaFile, "r");
      String metaLine = raFile.readLine();
      if (metaLine == null) {
        throw new IOException("No meta info in " +
            metaFile.getAbsolutePath());
      }
      String metaParts[] = metaLine.split(" ");
View Full Code Here

            }
            raf.seek(len - TESTRESULTS_END.length() - 10);// TODO: may not work on all OSes?
            String line;
            long pos = raf.getFilePointer();
            int end = 0;
            while ((line = raf.readLine()) != null)// reads to end of line OR end of file
            {
                end = line.indexOf(TESTRESULTS_END);
                if (end >= 0) // found the string
                {
                    break;
View Full Code Here

        tail.append("\n-------------------- "+tag+"---------------------\n");
        String[] lines = null;
        if (num >0) {
          lines = new String[num];
        }
        while ((line = rafile.readLine()) != null) {
          no_lines++;
          if (num >0) {
            if (no_lines <= num) {
              lines[no_lines-1] = line;
            }
View Full Code Here

            {
                aReader = new RandomAccessFile(aFile,"r");
                String aLine = "";
                while (aLine != null)
                {
                    aLine = aReader.readLine();
                    if (aLine != null)
                    {
                        aLine = aLine.trim();
                        if ( (! (aLine.length() < 2) ) &&
                             (! aLine.startsWith("#")) &&
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.