Convert the given content into an ATOM entry and write it to the given
stream.

@param content
Content object to send
@param stream
Stream to write to
@throws JAXBException
if content is malformed/not marshallable
186126
public void marshalEntry(Object content, OutputStream stream)
            throws JAXBException {
        marshaller.marshal(createEntry(content), stream);
    }
666618
public static InputStream toStream(String content, Charset charset) {
        byte[] bytes = content.getBytes(charset);
        return new ByteArrayInputStream(bytes);
    }
979806
public void writeElement(String name, List att, String content) throws KNXMLException
	{
		try {
			final Tag tag = new Tag(name, att, content, false);
			layout.push(tag);
		}
		catch (final IOException e) {
			throw new KNXMLException(e.getMessage());
		}
	}
167374
public JSON readFromStream( InputStream stream ) {
      try{
         StringBuffer xml = new StringBuffer();
         BufferedReader in = new BufferedReader( new InputStreamReader( stream ) );
         String line = null;
         while( (line = in.readLine()) != null ){
            xml.append( line );
         }
         return read( xml.toString() );
      }catch( IOException ioe ){
         throw new JSONException( ioe );
      }
   }
247341
public void writeObject(@NonNull ObjectOutputStream stream) throws IOException {
        stream.writeObject(id);
        stream.writeLong(createdTime);
        stream.writeLong(lastAccessedTime);
        stream.writeInt(maxInactiveInterval);
        stream.writeBoolean(isNew);
        stream.writeBoolean(isValid);
        stream.writeInt(mAttributes.size());
        String keys[] = mAttributes.keySet().toArray(EMPTY_ARRAY);
        for (String key : keys) {
            Object value = mAttributes.get(key);
            if (value != null && value instanceof Serializable) {
                stream.writeObject(key);
                stream.writeObject(value);
            }
        }
    }
12855
public void writeToFile(StringBuffer content, String filename, String encoding) throws NoSuchPathException, IOException{
		try {
			OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(filename), encoding);
			writer.write(content.toString(), 0, content.length());
			writer.flush();
			writer.close();
		} catch (FileNotFoundException e) {
			throw new NoSuchPathException(e);
		}
	}
636665
public static void writeContent(CharSequence content, File file, String encoding) {
        OutputStream os = null;
        try {
            os = new FileOutputStream(file);
            PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os, encoding));
            printWriter.println(content);
            printWriter.flush();
            os.flush();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                if (os != null) os.close();
            } catch (Exception e) {
                //
            }
        }
    }
1117797
private Element parseContent(String content) {
		Document doc = Jsoup.parseBodyFragment(content);
		doc.outputSettings().charset(outputEncoding);
		return doc.body();
	}
1334102
public void writeSBGN(Model model, OutputStream stream) {
		Sbgn sbgn = createSBGN(model);
		try {
			JAXBContext context = JAXBContext.newInstance("org.sbgn.bindings");
			Marshaller marshaller = context.createMarshaller();
			marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
			marshaller.marshal(sbgn, stream);
		} catch (JAXBException e) {
			throw new RuntimeException("writeSBGN: JAXB marshalling failed", e);
		}
	}
1034105
public void setXMLContent(byte[] xmlContent) {
        if (m_dsType == DS_TYPE.INLINE_XML) {
            ((DatastreamXMLMetadata)m_ds).xmlContent = xmlContent;
            ((DatastreamXMLMetadata)m_ds).DSSize = (xmlContent != null) ? xmlContent.length : -1;
        } else if (m_dsType == DS_TYPE.MANAGED) {
            ByteArrayInputStream bais = new ByteArrayInputStream(xmlContent);
            MIMETypedStream s = new MIMETypedStream("text/xml", bais, null,xmlContent.length);
            try {
                ((DatastreamManagedContent)m_ds).putContentStream(s);
            } catch (StreamIOException e) {
                throw new RuntimeException("Unable to update managed datastream contents", e);
            }
        } else
            // coding error if trying to use other datastream type
            throw new RuntimeException("XML datastreams must be of type Managed or Inline");
    }
873830
public void write(byte value) {
        if (count >= content.length - 1) {
            byte[] ns = new byte[content.length + 8];
            System.arraycopy(content, 0, ns, 0, count);
            this.content = ns;
        }
        content[count++] = value;
    }
1200028
public final void setContent(byte[] content)
    {
        //clear non relevant flags
        this.contentString=null;
        this.contentParts=null;
        this.contentType=ContentType.BINARY;

        if(content==null)
        {
            this.contentBinary=null;
        }
        else
        {
            this.contentBinary=content.clone();
        }
    }
1013611
public final void setContent(String content)
    {
        //clear non relevant flags
        this.contentBinary=null;
        this.contentParts=null;
        this.contentType=ContentType.STRING;

        this.contentString=content;
    }
781148
public void writeContent(final OutputStream out) throws IOException
    {
    	final byte[] contentBytes = DocWriter.getISOBytes(this.directContent);
   		out.write(contentBytes);
    }
692323
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "changeToken", scope = AppendContentStream.class)
	public JAXBElement<String> createAppendContentStreamChangeToken(String value) {
		return new JAXBElement<String>(_AppendContentStreamChangeToken_QNAME,
				String.class, AppendContentStream.class, value);
	}
211984
private void write(String attribute, String content)
    {
        Check.notNull(attribute);
        Check.notNull(content);

        try
        {
            root.setAttribute(attribute, content);
        }
        catch (final DOMException exception)
        {
            throw new LionEngineException(exception, ERROR_WRITE_ATTRIBUTE + attribute + ERROR_WRITE_CONTENT + content);
        }
    }
1167553
protected void writeResource(File file, byte[] content) {

        try {
            File folder;
            if (content == null) {
                // a folder is to be created
                folder = file;
            } else {
                // a file is to be written
                folder = file.getParentFile();
            }
            // make sure the parent folder exists
            if (!folder.exists()) {
                boolean success = folder.mkdirs();
                if (!success) {
                    LOG.error(
                        Messages.get().getBundle().key(Messages.LOG_CREATE_FOLDER_FAILED_1, folder.getAbsolutePath()));
                }
            }
            if (content != null) {
                // now write the file to the real file system
                OutputStream s = new FileOutputStream(file);
                s.write(content);
                s.close();
            }
        } catch (Exception e) {
            LOG.error(
                Messages.get().getBundle().key(Messages.LOG_WRITE_EXPORT_POINT_FAILED_1, file.getAbsolutePath()),
                e);
        }
    }