Examples of markSupported()


Examples of java.io.Reader.markSupported()

        assertEquals(-1, reader.read());
        assertEquals(false, reader.ready());
        assertEquals(0, reader.skip(2));
        assertEquals(0, reader.skip(-1));
       
        assertEquals(true, reader.markSupported());
        reader = sb.asReader();
        assertEquals('s', reader.read());
        reader.mark(-1);
        char[] array = new char[3];
        assertEquals(3, reader.read(array, 0, 3));

Examples of java.io.Reader.markSupported()

    public void testMarkAndReset() throws Exception {
        int position = 0;
        int readlimit = 10;
        Reader reader = new TestNullReader(100, true, false);
       
        assertTrue("Mark Should be Supported", reader.markSupported());

        // No Mark
        try {
            reader.reset();
            fail("Read limit exceeded, expected IOException ");

Examples of java.io.Reader.markSupported()

    /**
     * Test <code>mark()</code> not supported.
     */
    public void testMarkNotSupported() throws Exception {
        Reader reader = new TestNullReader(100, false, true);
        assertFalse("Mark Should NOT be Supported", reader.markSupported());

        try {
            reader.mark(5);
            fail("mark() should throw UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {

Examples of java.io.Reader.markSupported()

    }

    /** Test {@link Reader#markSupported()}. */
    public void testMarkSupported() {
        Reader reader = new CharSequenceReader("FooBar");
        assertTrue(reader.markSupported());
    }

    /** Test {@link Reader#mark(int)}. */
    public void testMark() throws IOException {
        Reader reader = new CharSequenceReader("FooBar");

Examples of java.io.Reader.markSupported()

  @Test
  public void testMarkSupported() throws IOException
  {
    Reader data = new StringReader(DATA);
    CountingReader reader = new CountingReader(data);
    assertEquals(data.markSupported(), reader.markSupported());
  }

  @Test
  public void testMarkAndReset() throws IOException
  {

Examples of java.io.Reader.markSupported()

        assertEquals(-1, reader.read());
        assertEquals(false, reader.ready());
        assertEquals(0, reader.skip(2));
        assertEquals(0, reader.skip(-1));
       
        assertEquals(true, reader.markSupported());
        reader = sb.asReader();
        assertEquals('s', reader.read());
        reader.mark(-1);
        char[] array = new char[3];
        assertEquals(3, reader.read(array, 0, 3));

Examples of java.io.StringReader.markSupported()

    harness.check(sr.ready(), "ready()");
  }
  catch (IOException e) {
  harness.fail("Unexpected IOException on ready()");
  }
  harness.check(sr.markSupported(), "markSupported()");
  try {
    sr.mark(0);   // For this class, readahead limit should be ignored
  harness.check(true, "mark()");
  }
  catch (IOException e) {

Examples of java.io.StringReader.markSupported()

  private Object stripHTML(String value, String column) {
    StringBuilder out = new StringBuilder();
    StringReader strReader = new StringReader(value);
    try {
      HTMLStripCharFilter html = new HTMLStripCharFilter(CharReader.get(strReader.markSupported() ? strReader : new BufferedReader(strReader)));
      char[] cbuf = new char[1024 * 10];
      while (true) {
        int count = html.read(cbuf);
        if (count == -1)
          break; // end of stream mark is -1

Examples of java.util.zip.DeflaterInputStream.markSupported()

    /**
     * @tests DeflaterInputStream#markSupported()
     */
    public void testMarkSupported() throws IOException {
        DeflaterInputStream dis = new DeflaterInputStream(is);
        assertFalse(dis.markSupported());
        dis.close();
        assertFalse(dis.markSupported());
    }

    /**
 

Examples of java.util.zip.InflaterInputStream.markSupported()

     * @tests java.util.zip.InflaterInputStream#markSupported()
     */
    public void test_markSupported() {
        InputStream is = new ByteArrayInputStream(new byte[10]);
        InflaterInputStream iis = new InflaterInputStream(is);
        assertFalse(iis.markSupported());
        assertTrue(is.markSupported());
    }

  /**
     * @tests java.util.zip.InflaterInputStream#read()
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.