code: SVG  parse(InputStream is, boolean enableInternalEntities) throws SVGParseException
     {
        // Transparently handle zipped files (.svgz)
        if (!is.markSupported()) {
           // We need a a buffered stream so we can use mark() and reset()
           is = new BufferedInputStream(is);
        }
        try
        {
           is.mark(3);
           int  firstTwoBytes = is.read() + (is.read() << 8);
           is.reset();
           if (firstTwoBytes == GZIPInputStream.GZIP_MAGIC) {
              // Looks like a zipped file.
              is = new BufferedInputStream( new GZIPInputStream(is) );
           }
        }
        catch (IOException ioe)
        {
           // Not a zipped SVG. Fall through and try parsing it normally.
        }
  
        try
        {
           // Mark the start in case we need to restart the parsing due to switching XML parser
           // 4096 chars is hopefully enough to capture most doctype declarations that have entities.
           is.mark(ENTITY_WATCH_BUFFER_SIZE);
  
           // Use XmlPullParser by default, which is faster, but doesn't support entity expansion.
           // In this parser we watch for capture doctype declarations, and then switch to the SAX
           // parser if any entities are defined in the doctype.
           parseUsingXmlPullParser(is, enableInternalEntities);
        }
        finally
        {
           try {
              is.close();
           } catch (IOException e) {
              Log.e(TAG, "Exception thrown closing input stream");
           }
        }
        return svgDocument;
     }
docs: =========================================================================