Package java.io

Examples of java.io.BufferedReader.reset()


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

        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

                    BufferedReader r = new BufferedReader(reader, limit);
                    r.mark(limit);
                    char b[] = new char[limit];
                    int i = r.read(b);
                    buffer.getPayload().append(b, 0, i);
                    r.reset();
                    message.setContent(Reader.class, r);
                } catch (Exception e) {
                    throw new Fault(e);
                }
               
View Full Code Here

        LOG.debug("");
        LOG.debug("****************************");
        LOG.debug("Parsing " + expectedResidue.getName());

        // Move br back to the line !entry.$RES.unit.atoms
        br.reset();
        // Read each residue
        readResidueSection(expectedResidue, br);
      }

      // Now add them to the main list
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

                        if (firstLineIsNames) {
                            // read first line and forget
                            reader.readLine();
                        }               
                    } else { // OK, we still have some data, restore it
                        reader.reset();
                    }
                }
            }
            return reader;
        } else {
View Full Code Here

                    BufferedReader r = new BufferedReader(reader, limit);
                    r.mark(limit);
                    char b[] = new char[limit];
                    int i = r.read(b);
                    buffer.getPayload().append(b, 0, i);
                    r.reset();
                    message.setContent(Reader.class, r);
                } catch (Exception e) {
                    throw new Fault(e);
                }
            }
View Full Code Here

                    BufferedReader r = new BufferedReader(reader, limit);
                    r.mark(limit);
                    char b[] = new char[limit];
                    int i = r.read(b);
                    buffer.getPayload().append(b, 0, i);
                    r.reset();
                    message.setContent(Reader.class, r);
                } catch (Exception e) {
                    throw new Fault(e);
                }
               
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.