Search in sources :

Example 1 with AndroidFileSource

use of master.flame.danmaku.danmaku.parser.android.AndroidFileSource in project bilibili-android-client by HotBitmapGG.

the class BiliDanmukuParser method parse.

@Override
public Danmakus parse() {
    if (mDataSource != null) {
        AndroidFileSource source = (AndroidFileSource) mDataSource;
        try {
            XMLReader xmlReader = XMLReaderFactory.createXMLReader();
            XmlContentHandler contentHandler = new XmlContentHandler();
            xmlReader.setContentHandler(contentHandler);
            xmlReader.parse(new InputSource(source.data()));
            return contentHandler.getResult();
        } catch (SAXException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return null;
}
Also used : InputSource(org.xml.sax.InputSource) IOException(java.io.IOException) AndroidFileSource(master.flame.danmaku.danmaku.parser.android.AndroidFileSource) XMLReader(org.xml.sax.XMLReader) SAXException(org.xml.sax.SAXException)

Example 2 with AndroidFileSource

use of master.flame.danmaku.danmaku.parser.android.AndroidFileSource in project GSYVideoPlayer by CarGuo.

the class BiliDanmukuParser method parse.

@Override
public Danmakus parse() {
    if (mDataSource != null) {
        AndroidFileSource source = (AndroidFileSource) mDataSource;
        try {
            XMLReader xmlReader = XMLReaderFactory.createXMLReader();
            XmlContentHandler contentHandler = new XmlContentHandler();
            xmlReader.setContentHandler(contentHandler);
            xmlReader.parse(new InputSource(source.data()));
            return contentHandler.getResult();
        } catch (SAXException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return null;
}
Also used : InputSource(org.xml.sax.InputSource) IOException(java.io.IOException) AndroidFileSource(master.flame.danmaku.danmaku.parser.android.AndroidFileSource) XMLReader(org.xml.sax.XMLReader) SAXException(org.xml.sax.SAXException)

Example 3 with AndroidFileSource

use of master.flame.danmaku.danmaku.parser.android.AndroidFileSource in project DanmakuFlameMaster by Bilibili.

the class BiliDanmukuParser method parse.

@Override
public Danmakus parse() {
    if (mDataSource != null) {
        AndroidFileSource source = (AndroidFileSource) mDataSource;
        try {
            XMLReader xmlReader = XMLReaderFactory.createXMLReader();
            XmlContentHandler contentHandler = new XmlContentHandler();
            xmlReader.setContentHandler(contentHandler);
            xmlReader.parse(new InputSource(source.data()));
            return contentHandler.getResult();
        } catch (SAXException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return null;
}
Also used : InputSource(org.xml.sax.InputSource) IOException(java.io.IOException) AndroidFileSource(master.flame.danmaku.danmaku.parser.android.AndroidFileSource) XMLReader(org.xml.sax.XMLReader) SAXException(org.xml.sax.SAXException)

Aggregations

IOException (java.io.IOException)3 AndroidFileSource (master.flame.danmaku.danmaku.parser.android.AndroidFileSource)3 InputSource (org.xml.sax.InputSource)3 SAXException (org.xml.sax.SAXException)3 XMLReader (org.xml.sax.XMLReader)3