Serializes the database to the output stream.

@param outputStream the output
@param encoding the encoding to use
@param indent the indent
@param lineSeparator the lineSeparator
@throws IOException in case the xml could not be written
322185
public void writeXML(OutputStream outputStream, String encoding, String indent, String lineSeparator)
  throws IOException {
    XMLOutputter outputter = new XMLOutputter();
    Format format = Format.getPrettyFormat();
    format.setEncoding(encoding);
    format.setIndent(indent);
    format.setLineSeparator(lineSeparator);
    outputter.setFormat(format);
    outputter.output(getDocument(), outputStream);
  }
10489
@Override
	public void write(final OutputStream output) throws IOException
	{
		initialize();
		if (content == null)
		{
			content = new byte[0];
		}
		output.write(content, 0, content.length);
		output.flush();
	}
443499
public void writeTo(final OutputStream out) throws IOException
	{
		if(out == null) throw new NullPointerException();
		
		final int n = arrays.size();
		for(int k = 0; k < n; k++) {
			byte[] src = (byte[])arrays.get(k);
			out.write(src);
		}
		if(pos > 0) out.write(buffer, 0, pos);
	}
1285267
public void serialize(final OutputStream out) throws IOException {
    final Writer writer = new BufferedWriter(new OutputStreamWriter(out));
    this.seqModel.serialize(out);
    writer.flush();
  }
786751
private void writeIndention(Writer writer, int indentDepth)
    throws IOException
    {
        if (logger.isLoggable(Level.FINER)) logger.entering(className, "writeIndention(Writer, int)");

        try
        {
            for (int i = 0; i < indentDepth; i++) 
            {
                writer.write(indent);
            }
        }
        catch (Exception ex)
        {
            IOException iox = new IOException("Error occurred on serialization of JSON text.");
            iox.initCause(ex);
            throw iox;
        }

        if (logger.isLoggable(Level.FINER)) logger.exiting(className, "writeIndention(Writer, int)");
    }
559610
public static void write(Node node, OutputStream out, String charset, int indent) {
		transform(new DOMSource(node), new StreamResult(out), charset, indent);
	}
310718
public void serialize(final OutputStream out) throws IOException {
    final Writer writer = new BufferedWriter(new OutputStreamWriter(out));

    for (final List<String> entry : this.predContexts) {
      writer.write(
          entry.get(0) + "\t" + entry.get(1) + "\t" + entry.get(2) + "\n");
    }
    writer.flush();
  }
193505
public static void serialize(OutputStream out, @Nonnull  JsonElement json, boolean pretty) throws IOException {
        Validate.notNull(out);
        BufferedOutputStream bufferedOut = new BufferedOutputStream(out);
        OutputStreamWriter w = new OutputStreamWriter(bufferedOut, UTF8);
        if(pretty) {
            serialize(w, json, pretty);
        } else {
            json.serialize(w);
            // subtle bug where not flushing this results in empty string when serializing to a ByteArrayOutputStream
            w.flush();
            bufferedOut.flush();
        }
    }
1123396
public static void write(final String data, final OutputStream output) throws IOException {
		if (data != null) {
			output.write(data.getBytes(Charsets.UTF_8));
		}
	}
281583
public <T> void write(final PrintWriter writer, final T object,
			final DataTypeDescriptor<T> descriptor, final boolean indent) throws IOException {
		if (writer == null) throw new NullPointerException("writer");
		if (descriptor == null) throw new NullPointerException("descriptor");

		JsonGenerator generator = factory.createGenerator(writer);
		if (indent) {
			generator.useDefaultPrettyPrinter();
		}

		write(object, descriptor, generator);
		generator.flush();
	}
1029402
public void setOutput(OutputStream os, String encoding) throws IOException {
		if (os == null)
			throw new IllegalArgumentException("output stream can not be null");
		reset();
		if (encoding != null) {
			out = new OutputStreamWriter(os, encoding);
		} else {
			out = new OutputStreamWriter(os);
		}
	}
316773
private void writeNewLineIndent() throws IOException
   {
      if (m_pretty)
      {
         if (!m_indent.isEmpty())
         {
            m_writer.write('\n');
            m_writer.write(m_indent);
         }
      }
   }
839031
private void indent() throws IOException {
        if (indent>=0) {
            out.write('\n');
            for (int i=indent*2; i>0; ) {
                int len = Math.min(i,INDENT.length);
                out.write(INDENT,0,len);
                i-=len;
            }
        }
    }
863702
public void writeTo(OutputStream out) throws IOException {
        if (!(out instanceof DataOutput)) {
            out = new DataOutputStream(out);
        }

        writeTo((DataOutput)out);

        out.flush();
    }
30877
@Override
    public void encode(OutputStream output, String nsURI) {
        encode(output, new Indenter(0), nsURI);
    }
867883
public void writeTo(final OutputStream output) throws IOException {
    final CodedOutputStream codedOutput = CodedOutputStream.newInstance(output);
    writeTo(codedOutput);
    codedOutput.flush();
  }
788634
public void writeTo(OutputStream out) throws IOException
    {
        int sz=size();

        if (sz<=AJP13ResponsePacket.__MAX_BUF)
            super.writeTo(out);
        else
        {
            int offset=preReserve();
            int data=sz-AJP13ResponsePacket.__DATA_HDR;

            while (data>AJP13ResponsePacket.__MAX_DATA)
            {
                _packet.setDataSize(AJP13ResponsePacket.__MAX_BUF-AJP13ResponsePacket.__HDR_SIZE);
                if (offset>0)
                    System.arraycopy(_buf,0,_buf,offset,AJP13ResponsePacket.__DATA_HDR);
                out.write(_buf,offset,AJP13ResponsePacket.__MAX_BUF);

                data-=AJP13ResponsePacket.__MAX_DATA;
                offset+=AJP13ResponsePacket.__MAX_DATA;
            }

            int len=data+AJP13ResponsePacket.__DATA_HDR;
            _packet.setDataSize(len-AJP13ResponsePacket.__HDR_SIZE);
            if (offset>0)
                System.arraycopy(_buf,0,_buf,offset,AJP13ResponsePacket.__DATA_HDR);
            out.write(_buf,offset,len);
        }
    }