Package java.io

Examples of java.io.BufferedReader.reset()


              rd.mark(read_idx++);
              if(rd.read(cbuf)==-1)
                break;
              if(cbuf[0]!='<')
                continue;
              rd.reset();
              break;
            }while(true);
            return (Channel)parser.parse(rd);
          }
          else{
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

                    reader.close();
                }
               
                @Override
                public void reset() throws IOException {
                    reader.reset();
                }
            };
        } else {
            return IOHelper.buffered(new FileInputStream(file));
        }
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

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

      BufferedReader bin = new BufferedReader(isr);
      String fileLine;
      SymbolTable table = null;
      bin.mark(2);
      if (bin.read() == '\t') {
        bin.reset();
        loadHeader(bin);
      } else {
        bin.reset();
      }
      while ((fileLine = bin.readLine()) != null) {
View Full Code Here

      bin.mark(2);
      if (bin.read() == '\t') {
        bin.reset();
        loadHeader(bin);
      } else {
        bin.reset();
      }
      while ((fileLine = bin.readLine()) != null) {
        if (fileLine.length() > 0) {
          table = addSymbolTable(fileLine);
          table.load(bin);
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

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    in.skip(6);
    in.mark(8);
    in.skip(7);
    in.reset();
    assertTrue("Wrong chars 2", in.read() == (char) 6
        && in.read() == (char) 7);
   
        BufferedReader br = new BufferedReader(new StringReader("01234"), 2);
        br.mark(3);
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.