当前位置: 首页>>代码示例>>Java>>正文


Java FastInfosetSource类代码示例

本文整理汇总了Java中com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource的典型用法代码示例。如果您正苦于以下问题:Java FastInfosetSource类的具体用法?Java FastInfosetSource怎么用?Java FastInfosetSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FastInfosetSource类属于com.sun.xml.internal.org.jvnet.fastinfoset包,在下文中一共展示了FastInfosetSource类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decode

import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource; //导入依赖的package包/类
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:FastInfosetCodec.java

示例2: parse

import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource; //导入依赖的package包/类
public void parse(InputStream document, OutputStream events, String workingDirectory) throws Exception {
    if (!document.markSupported()) {
        document = new BufferedInputStream(document);
    }

    document.mark(4);
    boolean isFastInfosetDocument = Decoder.isFastInfosetDocument(document);
    document.reset();

    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    DOMResult dr = new DOMResult();

    if (isFastInfosetDocument) {
        t.transform(new FastInfosetSource(document), dr);
    } else if (workingDirectory != null) {
        SAXParser parser = getParser();
        XMLReader reader = parser.getXMLReader();
        reader.setEntityResolver(createRelativePathResolver(workingDirectory));
        SAXSource source = new SAXSource(reader, new InputSource(document));

        t.transform(source, dr);
    } else {
        t.transform(new StreamSource(document), dr);
    }

    SAXEventSerializer ses = new SAXEventSerializer(events);
    t.transform(new DOMSource(dr.getNode()), new SAXResult(ses));
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:30,代码来源:FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent.java

示例3: decode

import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource; //导入依赖的package包/类
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
    /* Implements similar logic as the XMLMessage.create(String, InputStream).
     * But it's faster, as we know the InputStream has FastInfoset content*/
    Message message = null;
    in = hasSomeData(in);
    if (in != null) {
        message = Messages.createUsingPayload(new FastInfosetSource(in),
                SOAPVersion.SOAP_11);
    } else {
        message = Messages.createEmpty(SOAPVersion.SOAP_11);
    }

    packet.setMessage(message);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:15,代码来源:FastInfosetCodec.java

示例4: parse

import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource; //导入依赖的package包/类
public void parse(InputStream finf, OutputStream xml) throws Exception {
    Transformer tx = TransformerFactory.newInstance().newTransformer();
    tx.transform(new FastInfosetSource(finf), new StreamResult(xml));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:FI_SAX_XML.java


注:本文中的com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。