Java tutorial
//package com.java2s; /* * Copyright (c) 2012 European Synchrotron Radiation Facility, * Diamond Light Source Ltd. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ import java.io.ByteArrayInputStream; import java.io.InputStream; public class Main { /** * Some code copied from Passerelle (theirs private method) * @return */ private static InputStream openContentStream() { String contents = "<?xml version=\"1.0\" standalone=\"no\"?> \r\n" + "<!DOCTYPE entity PUBLIC \"-//UC Berkeley//DTD MoML 1//EN\" \"http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd\"> \r\n" + "<entity name=\"newModel\" class=\"ptolemy.actor.TypedCompositeActor\"> \r\n" + " <property name=\"_createdBy\" class=\"ptolemy.kernel.attributes.VersionAttribute\" value=\"7.0.1.4\" /> \r\n" + " <property name=\"_dawnVersion\" class=\"ptolemy.kernel.attributes.VersionAttribute\" value=\"" + System.getProperty("dawn.workbench.version") + "\" /> \r\n" + " <property name=\"Director\" class=\"com.isencia.passerelle.domain.cap.Director\" > \r\n" + " <property name=\"_location\" class=\"ptolemy.kernel.util.Location\" value=\"{20, 20}\" /> \r\n" + " </property> \r\n" + "</entity>"; return new ByteArrayInputStream(contents.getBytes()); } }