Package java.io

Examples of java.io.BufferedReader.reset()


      String line = jsonReader.readLine();
      if (line == null) {
        fail("Didn't find start of JSON string");
      }
      if (line.startsWith("{")) {
        jsonReader.reset();
        break;
      }
    }
    return jsonReader;
  }
View Full Code Here


            if (saveConfig == null) {// not a valid header
                log.info(filename
                        + " does not appear to have a valid header. Using default configuration.");
                saveConfig = (SampleSaveConfiguration) resultCollector
                        .getSaveConfig().clone(); // may change the format later
                dataReader.reset(); // restart from beginning
                lineNumber = 0;
            }
            String[] parts;
            final char delim = saveConfig.getDelimiter().charAt(0);
            // TODO: does it matter that an empty line will terminate the loop?
View Full Code Here

            x = x.replaceAll("&", "&") ;
            x = x.replaceAll("<", "&lt;") ;
            x = x.replaceAll(">", "&gt;") ;
            pw.println(x) ;
        }
        try { in.reset() ;} catch (IOException e) { System.out.println("DumpServlet: Reset of content failed: "+e) ; }
    }
   
    /**
     * <code>dumpEnvironment</code>
     * @return String that is the HTML of the System properties as name/value pairs.
View Full Code Here

      }
      InputStreamReader parstream = new InputStreamReader(par_in);
      buf_in = new BufferedReader(parstream);
      buf_in.mark(2);
      buf_in.read(); // just read one character to see if we can
      buf_in.reset();
    }
    catch (IOException e){
      try{
        buf_in = new BufferedReader(new FileReader(p_resourceName));
        buf_in.mark(2);
View Full Code Here

    catch (IOException e){
      try{
        buf_in = new BufferedReader(new FileReader(p_resourceName));
        buf_in.mark(2);
        buf_in.read();
        buf_in.reset();
      }
      catch (IOException e1){
        buf_in = null;
      }
    }
View Full Code Here

            // TIKA-240: Drop the BOM when extracting plain text
            reader.mark(1);
            int bom = reader.read();
            if (bom != '\ufeff') { // zero-width no-break space
                reader.reset();
            }

            XHTMLContentHandler xhtml =
                new XHTMLContentHandler(handler, metadata);
            xhtml.startDocument();
View Full Code Here

                    reader.close();
                }
               
                @Override
                public void reset() throws IOException {
                    reader.reset();
                }
            };
        } else {
            return IOHelper.buffered(new FileInputStream(file));
        }
View Full Code Here

                                    "function(event){" + tail.toString() + "}")));
                    // XXX CharSequenceReader
                    reader.mark(1);
                    int c = reader.read();
                    if (c != 0xFEFF) {
                        reader.reset();
                    }
                    try {
                        Context context = ContextFactory.getGlobal().enterContext();
                        context.setOptimizationLevel(0);
                        context.setLanguageVersion(Context.VERSION_1_6);
View Full Code Here

                                    "function(event){" + tail.toString() + "}")));
                    // XXX CharSequenceReader
                    reader.mark(1);
                    int c = reader.read();
                    if (c != 0xFEFF) {
                        reader.reset();
                    }
                    try {
                        Context context = ContextFactory.getGlobal().enterContext();
                        context.setOptimizationLevel(0);
                        context.setLanguageVersion(Context.VERSION_1_6);
View Full Code Here

        chars)), 12);

    in.skip(6);
    in.mark(14);
    in.read(new char[14], 0, 14);
    in.reset();
    assertTrue("Wrong chars", in.read() == (char) 6
        && in.read() == (char) 7);

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    in.skip(6);
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.