Here you can find the source of marshal(Object object, OutputStream stream)
Parameter | Description |
---|---|
object | Object |
stream | Output stream to write to |
public static void marshal(Object object, OutputStream stream) throws Exception
//package com.java2s; //License from project: Open Source License import javax.xml.bind.JAXB; import java.io.*; public class Main { /**/* w w w .j a va 2 s. c om*/ * Marshal an arbitrary object with JAXB. * * @param object Object * @param stream Output stream to write to */ public static void marshal(Object object, OutputStream stream) throws Exception { JAXB.marshal(object, stream); stream.close(); } }