Examples of markSupported()


Examples of java.io.InputStream.markSupported()

     * @throws Throwable
     */
    public void load(String fileName) throws Throwable {
        ExcelDataParser parser = null;
        InputStream inp = new FileInputStream(fileName);
        if (!inp.markSupported())
            inp = new PushbackInputStream(inp, 8);
        if (POIFSFileSystem.hasPOIFSHeader(inp)) {
            parser = new HSSFParser(this);
        } else if (POIXMLDocument.hasOOXMLHeader(inp)) {
            parser = new XSSFParser(this);

Examples of java.io.InputStream.markSupported()

    protected Entity deserializeEntity(HttpServletRequest request, EntityType entityType)
        throws IOException, FalconException {

        EntityParser<?> entityParser = EntityParserFactory.getParser(entityType);
        InputStream xmlStream = request.getInputStream();
        if (xmlStream.markSupported()) {
            xmlStream.mark(XML_DEBUG_LEN); // mark up to debug len
        }
        try {
            return entityParser.parse(xmlStream);
        } catch (FalconException e) {

Examples of java.io.InputStream.markSupported()

            xmlStream.mark(XML_DEBUG_LEN); // mark up to debug len
        }
        try {
            return entityParser.parse(xmlStream);
        } catch (FalconException e) {
            if (LOG.isDebugEnabled() && xmlStream.markSupported()) {
                try {
                    xmlStream.reset();
                    String xmlData = getAsString(xmlStream);
                    LOG.debug("XML DUMP for (" + entityType + "): " + xmlData, e);
                } catch (IOException ignore) {

Examples of java.io.InputStream.markSupported()

                            // Couldn't open the stream, go to next entry.
                            openFailed = true;
                            continue;
                        }

                        if (!is.markSupported())
                            // Doesn't support mark so wrap with
                            // BufferedInputStream that does.
                            is = new BufferedInputStream(is);
                    }

Examples of java.io.InputStream.markSupported()

        return _spreadsheetReaderDelegate;
    }

    private InputStream getInputStream() throws MetaModelException {
        InputStream inputStream = _resource.read();
        if (!inputStream.markSupported()) {
            inputStream = new PushbackInputStream(inputStream, 8);
        }
        return inputStream;
    }

Examples of java.io.InputStream.markSupported()

                }

                if ( entity != null ) {
                    InputStream content = entity.getContent();
                    if ( retryCount > 0 ) {
                        if ( content.markSupported() ) {
                            content.reset();
                            content.mark(-1);
                        }
                    } else {
                        if ( content.markSupported() ) {

Examples of java.io.InputStream.markSupported()

                        if ( content.markSupported() ) {
                            content.reset();
                            content.mark(-1);
                        }
                    } else {
                        if ( content.markSupported() ) {
                            content.mark(-1);
                        }
                    }
                }

Examples of java.io.InputStream.markSupported()

  throws IOException {
    InputStream in = fs.open(p);
    try {
      // I need to be able to move back in the stream if this is not a pb serialization so I can
      // do the Writable decoding instead.
      in = in.markSupported()? in: new BufferedInputStream(in);
      int pblen = ProtobufUtil.lengthOfPBMagic();
      in.mark(pblen);
      byte [] pbuf = new byte[pblen];
      int read = in.read(pbuf);
      if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen);

Examples of java.io.Reader.markSupported()

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

  @Test
  public void testMarkAndReset() throws IOException
  {

Examples of java.io.Reader.markSupported()

  @Test
  public void testMarkSupported() throws IOException
  {
    Reader reader = new ConcatReader(mock(Reader.class));
    assertFalse(reader.markSupported());
  }

  @Test(expected = IOException.class)
  public void testMark() throws IOException
  {
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.