Android XML InputStream Parse parse(InputStream in, ContentHandler handler)

Here you can find the source of parse(InputStream in, ContentHandler handler)

Description

parse

License

Open Source License

Declaration

public static XMLReader parse(InputStream in, ContentHandler handler)
            throws SAXException, IOException 

Method Source Code

//package com.java2s;
/*/* w  w w.j a  v  a2s .c o m*/
 * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 * 
 *  http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

import java.io.IOException;
import java.io.InputStream;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

public class Main {
    public static XMLReader parse(InputStream in, ContentHandler handler)
            throws SAXException, IOException {

        XMLReader reader = XMLReaderFactory.createXMLReader();
        reader.setContentHandler(handler);
        reader.parse(new InputSource(in));
        in.close();
        return reader;
    }
}

Related

  1. LoadXml(InputStream stream)
  2. getDocument(InputStream is)
  3. getPullParser(InputStream in, String encoding)
  4. newPullParser(InputStream input)
  5. obtainEncodingStringFromInputStream(InputStream bis)
  6. parse(InputStream is)
  7. parse(InputStream is)
  8. parse(InputStream is, Class cls, List fields, List elements, String itemelement)
  9. parseXml(InputStream is, String elementsTagName)