Examples of reset()


Examples of java.io.FilterInputStream.reset()

        assertEquals(0, readCount.get());

        assertEquals(1000, IOUtils.readFully(in, test, 0, 1000));
        IOUtilsTest.assertEquals(data, test);
        test = new byte[1001];
        in.reset();
        in.mark(10000);
        assertEquals(1000, IOUtils.readFully(in, test, 0, 1001));
        assertEquals(0, IOUtils.readFully(in, test, 0, 0));
    }
View Full Code Here

Examples of java.io.InputStream.reset()

        DocumentCollection collection = (DocumentCollection)getServletContext().getAttribute( "collection" );
        if ( collection == null ) LOGGER.fatal( "The servlet context does not contain a document collection." );
        response.setContentType( request.getParameter( "m" ) );
        response.setCharacterEncoding( "UTF-8" );
        InputStream rawContent = collection.stream( Integer.parseInt( request.getParameter( "doc" ) ) );
        for( int i = skip; i-- != 0; ) rawContent.reset();
        IOUtils.copy( rawContent, response.getOutputStream() );
      }
    } catch( RuntimeException e ) {
      e.printStackTrace();
      LOGGER.error( e.toString() );
View Full Code Here

Examples of java.io.InputStreamReader.reset()

        Reader reader        = new InputStreamReader(connection.getInputStream());
        SAXReader saxReader  = new SAXReader();
       
        // skip leading 0xFEFF character if present
        if (reader.read() != 65279) {
          reader.reset();
        }
       
        Document xmlDoc = saxReader.read(reader);

        connection.disconnect();
View Full Code Here

Examples of java.io.LineNumberReader.reset()

        put("importer", importer);
        return importer;
      } else {
        LineNumberReader reader = new LineNumberReader(new InputStreamReader(is));
        if (null == reader.readLine()) return null;
        reader.reset();
        EntityImporter importer = (clazz == null) ? new DefaultEntityImporter()
            : new DefaultEntityImporter(clazz);
        importer.setReader(new CsvItemReader(reader));
        return importer;
      }
View Full Code Here

Examples of java.io.ObjectOutputStream.reset()

            logger.error("Exception when creating writer sending object: " + object, e);
            return false;
        }

        try {
            writer.reset();
            writer.flush();
            writer.writeObject(object);
            writer.flush();

            return true;
View Full Code Here

Examples of java.io.PushbackInputStream.reset()

  public void test_reset() {
    PushbackInputStream pb = new PushbackInputStream(
        new ByteArrayInputStream(new byte[] { 0 }), 2);
    try {
      pb.reset();
      fail("Should throw IOException");
    } catch (IOException e) {
      // expected
    }
  }
View Full Code Here

Examples of java.io.Reader.reset()

     
      // 7. Set up a Reader over the read content
      r = getTrecDocReader(docBuf);
      // Resetting the thread's reader means it will reuse the instance
      // allocated as well as re-read from docBuf.
      r.reset();
     
      // count char length of parsed html text (larger than the plain doc body text).
      addBytes(docBuf.length());
    }
View Full Code Here

Examples of java.io.StringReader.reset()

                reader = new StringReader(headerValue);
                // get the first character to decide - expect '(' or '<'
                try {
                    reader.mark(1);
                    firstChar = readWhiteSpace(reader);
                    reader.reset();
                } catch (IOException ignore) {
                    // may be thrown according to API but is only thrown by the
                    // StringReader class if the reader is already closed.
                }
View Full Code Here

Examples of java.nio.Buffer.reset()

    buf = factory.newInstance();
    h.check(buf.mark(), buf, "mark: buf.mark()");
    checkStatus(h, buf, "mark", 10, 10, true, 10, 0);
    buf.position(5);
    checkStatus(h, buf, "mark", 10, 10, true, 5, 5);
    h.check(buf.reset(), buf, "mark: buf.reset()");
    checkStatus(h, buf, "mark", 10, 10, true, 10, 0);
    buf.position(6);
    checkStatus(h, buf, "mark", 10, 10, true, 4, 6);
    buf.reset();
    checkStatus(h, buf, "mark", 10, 10, true, 10, 0);
View Full Code Here

Examples of java.nio.ByteBuffer.reset()

      if (pattern.match(view) == false) {
        status = false;
        break;
      }
      view.reset();

      if (p + MAX_HEADER_LENGTH > view.capacity()) {
        break;
      }
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.