LayoutUtilCommon.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:jo-widgets 作者:
/**
 * Writes an object to XML.
 * 
 * @param out The boject out to write to. Will not be closed.
 * @param o The object to write.
 */
public synchronized void writeAsXML(final ObjectOutput out, final Object o) throws IOException {
    if (writeOutputStream == null) {
        writeOutputStream = new ByteArrayOutputStream(16384);
    }

    writeOutputStream.reset();

    writeXMLObject(writeOutputStream, o, new ExceptionListener() {
        @Override
        public void exceptionThrown(final Exception e) {
            LOGGER.error(e);
        }
    });

    final byte[] buf = writeOutputStream.toByteArray();

    out.writeInt(buf.length);
    out.write(buf);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号