Code example for LSOutput

Methods: setByteStream

            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
            DOMImplementationLS impl =
                    (DOMImplementationLS) registry.getDOMImplementation("LS");
            LSSerializer writer = impl.createLSSerializer();
            LSOutput output = impl.createLSOutput();
            writer.write(element, output);
            return byteArrayOutputStrm.toString();
        } catch (Exception e) {
            throw new Exception("Error Serializing the SAML Response", e);
     * Compressing and Encoding the response 
     * @param xmlString String to be encoded 
     * @return compressed and encoded String 
    public static String encode(String xmlString) throws Exception {
Contextual code suggestions in your IDE  Get Codota for Java