Write a collection of NucleotideSequences to a file

@param outputStream
@param dnaSequences
@throws Exception
771051
public static void writeNucleotideSequence(OutputStream outputStream,
			Collection<DNASequence> dnaSequences) throws Exception {
		writeNucleotideSequence(outputStream, dnaSequences, LINEAR_DNA);
	}
1202508
public static void writeXml(Serializable serializable, OutputStream output) throws IOException {
		TransportFormat.XML.writeSerializableTo(serializable, output);
	}
1177355
public static void write(final InputStream inputStream, final OutputStream outputStream)
		throws FileNotFoundException, IOException
	{
		int counter;
		final byte byteArray[] = new byte[FileConst.BLOCKSIZE];
		while ((counter = inputStream.read(byteArray)) != -1)
		{
			outputStream.write(byteArray, 0, counter);
		}
	}
1263125
public static void writeProteinSequence(OutputStream outputStream,
			Collection<ProteinSequence> proteinSequences) throws Exception {

		GenbankWriter<ProteinSequence, AminoAcidCompound> genbankWriter = new GenbankWriter<ProteinSequence, AminoAcidCompound>(
				outputStream,
				proteinSequences,
				new GenericGenbankHeaderFormat<ProteinSequence, AminoAcidCompound>());
		genbankWriter.process();

	}
718207
private void writeObject(final ObjectOutputStream out)
		throws IOException
	{
		out.defaultWriteObject();

		out.writeInt(length());
		out.writeObject(lengthRange());
		out.writeLong(_min);
		out.writeLong(_max);

		for (LongGene gene : _genes) {
			out.writeLong(gene.getAllele());
		}
	}
536180
public static void writeGeneSequence(File file, Collection<GeneSequence> geneSequences,boolean showExonUppercase) throws Exception {
		FileOutputStream outputStream = new FileOutputStream(file);
		BufferedOutputStream bo = new BufferedOutputStream(outputStream);
		writeGeneSequence(bo, geneSequences,showExonUppercase);
		bo.close();
		outputStream.close();
	}
633171
private void writeObject(final ObjectOutputStream out)
		throws IOException
	{
		out.defaultWriteObject();

		out.writeInt(_length);
		out.writeDouble(_p);
		out.writeInt(_genes.length);
		out.write(_genes);
	}
104772
@Override
  public void write(OutputStream out) throws IOException {
    try {
      valueSerializer = null;

      XMLStreamWriter serializer = factory.createXMLStreamWriter(out,
        "UTF-8");
      serializer.setPrefix(RequestConstants.RESTAPI_PREFIX,
        RequestConstants.RESTAPI_NS);
      serializer.setPrefix(RequestConstants.SEARCH_PREFIX,
        RequestConstants.SEARCH_NS);
      serializer.setPrefix("xsi",
        XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
      serializer.setPrefix("xs", XMLConstants.W3C_XML_SCHEMA_NS_URI);

      serializer.writeStartDocument("utf-8", "1.0");

      serializer.writeStartElement(RequestConstants.RESTAPI_PREFIX,
        "rule", RequestConstants.RESTAPI_NS);

      serializer.writeStartElement(RequestConstants.RESTAPI_PREFIX,
        "name", RequestConstants.RESTAPI_NS);
      serializer.writeCharacters(getName());
      serializer.writeEndElement();

      serializer.writeStartElement(RequestConstants.RESTAPI_PREFIX,
        "description", RequestConstants.RESTAPI_NS);
      String description = getDescription();
      if ( description != null ) serializer.writeCharacters(description);
      serializer.writeEndElement();
      serializer.flush();

      // logger.debug("Send: " + new String(queryPayload));
      XMLEventWriter eventWriter = factory.createXMLEventWriter(out);
      for (XMLEvent event : this.queryPayload) {
        eventWriter.add(event);
      }
      eventWriter.flush();
      out.flush();

      writeMetadataElement(serializer);

      serializer.writeEndElement();
      serializer.writeEndDocument();
    } catch (XMLStreamException e) {
      throw new MarkLogicIOException("Failed to serialize rule", e);
    } catch (TransformerFactoryConfigurationError e) {
      throw new MarkLogicIOException("Failed to serialize rule", e);
    } catch (TransformerException e) {
      throw new MarkLogicIOException("Failed to serialize rule", e);
    } finally {
      valueSerializer = null;
    }

  }
228047
@Override
    public void writeXML(@WillClose Writer out) throws IOException {
        assert project != null;
        bugsPopulated();
        XMLOutput xmlOutput;
        // if (project == null) throw new NullPointerException("No project");


        xmlOutput = new OutputStreamXMLOutput(out);

        writeXML(xmlOutput);
    }
527051
@VisibleForTesting
  static void writeBytesToStream(byte[] bytes, final OutputStream outputStream)
      throws IOException {
    new ByteSink() {
      @Override
      public OutputStream openStream() {
        return outputStream;
      }
    }.write(bytes);
  }
1320567
private void writeSequenceBegin(int size) throws TException {
        getCurrentContext().write();
        if (getCurrentContext().isMapKey()) {
            throw new TException(SEQUENCE_AS_KEY_ILLEGAL);
        }
        pushContext(new SequenceContext(null));

        try {
            getCurrentWriter().writeStartArray();
        } catch (IOException ex) {
            throw new TTransportException(ex);
        }
    }
284774
@Override
	public void writeResult(Map<BioPAXElement, List<Match>> matches, OutputStream out)
		throws IOException
	{
		writeResultAsSIF(matches, out, true, getSourceLabel(), getTargetLabel());
	}
477530
public void writeTo(OutputStream outputStream) {
        try {
            ClassWriter classWriter = generateClassBytes();

            writeClassToDisk(outputStream, classWriter);
        } catch (Throwable e) {
            throw new ClassGenerationException("Error generating annotation metadata: " + e.getMessage(), e);
        }
    }
734116
public static void writeGenerators( IGeneratorSet generators, OutputStream outputStream)
    {
    try( GeneratorSetJsonWriter writer = new GeneratorSetJsonWriter( outputStream))
      {
      writer.write( generators);
      }
    catch( Exception e)
      {
      throw new RuntimeException( "Can't write generator definitions", e);
      }
    }
199667
private void writeObject(final ObjectOutputStream out)
		throws IOException
	{
		out.defaultWriteObject();

		out.writeInt(length());
		out.writeObject(_min);
		out.writeObject(_max);

		for (BigIntegerGene gene : _genes) {
			out.writeObject(gene.getAllele());
		}
	}
65251
public static void writeFile(final Document input, final File output) {
        final StreamResult result = new StreamResult(new StringWriter());

        format(new DOMSource(input), result);

        try {
            new FileWriter(output).write(result.getWriter().toString());
        } catch (final IOException ioEx) {
            LOGGER.error("Problem writing XML to file.", ioEx);
        }
    }
801418
public static void writeCollection(XMLOutput xmlOutput, Collection<? extends XMLWriteable> collection) throws IOException {
        for (XMLWriteable obj : collection) {
            obj.writeXML(xmlOutput);
        }
    }