Examples of markSupported()


Examples of javax.servlet.ServletInputStream.markSupported()

    private Properties getProperties(HttpServletRequest request) throws IOException {
        Properties props = new Properties();
        ServletInputStream xmlStream = request == null ? null : request.getInputStream();
        if (xmlStream != null) {
            if (xmlStream.markSupported()) {
                xmlStream.mark(XML_DEBUG_LEN); // mark up to debug len
            }
            props.load(xmlStream);
        }
        return props;

Examples of javax.sound.sampled.AudioInputStream.markSupported()

        assertEquals(format, ais.getFormat());
        assertEquals(10, ais.getFrameLength());
        assertEquals(40, ais.available());
        assertEquals(8, ais.read(new byte[10]));
        assertEquals(32, ais.available());
        assertTrue(ais.markSupported());
        ais.mark(1000);
        assertEquals(8, ais.read(new byte[10]));
        assertEquals(24, ais.available());
        assertEquals(0, ais.skip(2));
        assertEquals(8, ais.skip(10));

Examples of org.apache.commons.compress.compressors.pack200.Pack200CompressorInputStream.markSupported()

            new Pack200CompressorInputStream(new FileInputStream(getFile("bla.jar")),
                                             m);
        try {
            // packed file is a jar, which is a zip so it starts with
            // a local file header
            assertTrue(is.markSupported());
            is.mark(5);
            assertEquals(0x50, is.read());
            byte[] rest = new byte[3];
            assertEquals(3, is.read(rest));
            assertEquals(0x4b, rest[0]);

Examples of org.apache.derby.iapi.types.ReaderToUTF8Stream.markSupported()

    private InputStream getStream(int length) {
        Reader src = new LoopingAlphabetReader(length,
                                        CharAlphabet.modernLatinLowercase());
        InputStream is = new ReaderToUTF8Stream(
                src, length, 0, "CLOB", new ClobStreamHeaderGenerator(false));
        assertTrue("The stream doesn't support mark/reset", is.markSupported());
        return is;
    }

    /**
     * Checks the beginning of the stream, which is expected to consist of five

Examples of org.apache.hadoop.hdfs.util.ExactSizeInputStream.markSupported()

  }

  @Test
  public void testMark() throws IOException {
    ExactSizeInputStream s = new ExactSizeInputStream(byteStream("he"), 5);
    assertFalse(s.markSupported());
    try {
      s.mark(1);
      fail("Mark should not succeed");
    } catch (UnsupportedOperationException uoe) {
      // expected

Examples of org.apache.hadoop.hive.ql.udf.xml.UDFXPathUtil.ReusableStringReader.markSupported()

  }
 
  @Test
  public void testMarkReset() throws IOException {
    Reader reader = new ReusableStringReader();
    if (reader.markSupported()) {
      ((ReusableStringReader)reader).set(fox);
      assertTrue(reader.ready());
     
      char[] cc = new char[6];
      int read;

Examples of org.apache.lucene.analysis.CharFilter.markSupported()

    } catch (Exception e) {
      assertEquals("mark(int)", e.getMessage());
    }
   
    try {
      cs.markSupported();
      fail();
    } catch (Exception e) {
      assertEquals("markSupported()", e.getMessage());
    }
   

Examples of org.apache.lucene.analysis.CharFilter.markSupported()

    } catch (Exception e) {
      assertEquals("mark(int)", e.getMessage());
    }
   
    try {
      cs.markSupported();
      fail();
    } catch (Exception e) {
      assertEquals("markSupported()", e.getMessage());
    }
   

Examples of org.apache.lucene.analysis.CharStream.markSupported()

    } catch (Exception e) {
      assertEquals("mark(int)", e.getMessage());
    }
   
    try {
      cs.markSupported();
      fail();
    } catch (Exception e) {
      assertEquals("markSupported()", e.getMessage());
    }
   

Examples of org.apache.lucene.util.UnsafeByteArrayInputStream.markSupported()

  @Test
  public void testMark() throws Exception {
    byte[] bytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    UnsafeByteArrayInputStream ubais = new UnsafeByteArrayInputStream(bytes);
    assertTrue(ubais.markSupported());
    int markIndex = 3;
    // Advance the index
    for (int i = 0; i < markIndex; i++) {
      ubais.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.