Package java.io

Examples of java.io.BufferedReader.reset()


        chars)), 12);
    try {
      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);
    } catch (IOException e) {
      fail("Exception during mark test 2:" + e);
    }
View Full Code Here


    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    try {
      in.skip(6);
      in.mark(8);
      in.skip(7);
      in.reset();
      assertTrue("Wrong chars 2", in.read() == (char) 6
          && in.read() == (char) 7);
    } catch (IOException e) {
      fail("Exception during mark test 3:" + e);
    }
View Full Code Here

        while(in.ready())
        {
            pw.println(in.readLine());
        }

        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
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

            openInput();
            BufferedReader reader = new BufferedReader(new InputStreamReader(in, charset));
            // if necessary, strip the BOM from the front of the file
            reader.mark(1);
            if (reader.read() != UTF8_BOM) {
                reader.reset();
            }
            ScriptReader r = new ScriptReader(reader);
            while (true) {
                String sql = r.readStatement();
                if (sql == null) {
View Full Code Here

    public ReadableRepresentation readRepresentation(Reader reader) {
        try {
            Reader bufferedReader = new BufferedReader(reader);
            bufferedReader.mark(1);
            char firstChar = (char) bufferedReader.read();
            bufferedReader.reset();

            Class<? extends RepresentationReader> readerClass;
            switch (firstChar) {
                case '{':
                    readerClass = representationReaders.get(new ContentType(HAL_JSON));
View Full Code Here

                    break;
                }
            }
        } finally {
            is.reset();
            br.reset();
        }
        return sb.toString();
    }

    public TikaMIMETypeDetector(Purifier purifier) {
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

            // 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

      long lineNumber=1;
      SampleSaveConfiguration saveConfig = CSVSaveService.getSampleSaveConfiguration(line,filename);
      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;
      while ((parts = csvReadFile(dataReader, saveConfig.getDelimiter().charAt(0))).length != 0) {
        lineNumber++;
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.