Write a taxonomy to an open stream out in GG format. Code calling this
        function must open and close the io object.
554955
def write(self, output_io):
        ''''''
        for name, tax in self.taxonomy.items():
            output_io.write("%s\t%s\n" % (name, '; '.join(tax)))
93528
def export()
      super
      f = new_output_file('obo_nomenclature.obo') 
     
      # header 
      f.puts 'format-version: 1.2'
      f.puts "date: #{@time}"
      f.puts 'saved-by: someone'
      f.puts 'auto-generated-by: Taxonifi'
      f.puts 'synonymtypedef: COMMONNAME "common name"'
      f.puts 'synonymtypedef: MISSPELLING "misspelling" EXACT'
      f.puts 'synonymtypedef: TAXONNAMEUSAGE "name with (author year)" NARROW'
      f.puts "default-namespace: #{@namespace}"
      f.puts "ontology: FIX-ME-taxonifi-ontology\n\n" 

      # terms
      @name_collection.collection.each do |n|
        f.puts '[Term]'
        f.puts "id: #{id_string(n)}"
        f.puts "name: #{n.name}"
        f.puts "is_a: #{id_string(n.parent)} ! #{n.parent.name}" if n.parent
        f.puts "property_value: has_rank #{rank_string(n)}"
        f.puts
      end

      # typedefs
      f.puts "[Typedef]"
      f.puts "id: has_rank"
      f.puts "name: has taxonomic rank"
      f.puts "is_metadata_tag: true"

      true
    end
56578
@Override
  public void write(ByteCodeWriter out)
    throws IOException
  {
    out.writeUTF8Const(getName());

    TempOutputStream ts = new TempOutputStream();
    //ts.openWrite();
    //WriteStream ws = new WriteStream(ts);
    ByteCodeWriter o2 = new ByteCodeWriter(ts, out.getJavaClass());

    o2.writeShort(_methods.size());
    for (int i = 0; i < _methods.size(); i++) {
      BootstrapMethod method = _methods.get(i);
      
      o2.writeShort(method.getMethodRef());
      o2.writeShort(method.getArgumentSize());
      
      for (ConstantPoolEntry entry : method.getArguments()) {
        o2.writeShort(entry.getIndex());
      }
    }
    
    ts.close();
    
    out.writeInt(ts.getLength());
    
    TempBuffer ptr = ts.getHead();

    for (; ptr != null; ptr = ptr.next()) {
      out.write(ptr.buffer(), 0, ptr.length());
    }

    ts.destroy();
  }
116489
public static void writeObjects(OutputStream out, boolean isCloseOut, Serializable... contents) throws IORuntimeException {
		ObjectOutputStream osw = null;
		try {
			osw = out instanceof ObjectOutputStream ? (ObjectOutputStream) out : new ObjectOutputStream(out);
			for (Object content : contents) {
				if (content != null) {
					osw.writeObject(content);
					osw.flush();
				}
			}
		} catch (IOException e) {
			throw new IORuntimeException(e);
		} finally {
			if (isCloseOut) {
				close(osw);
			}
		}
	}
1362091
@Override
  public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);

    // Encode flag
    out.writeBoolean(isPruned);
    // Encode size
    out.writeVInt(size);
    // Encode type of encoding
    out.writeVInt(termsEncoding.ordinal());
    // Encode terms
    out.writeBytesRef(encodedTerms);
    // Release terms
    encodedTerms = null;
  }
355762
private void writeFieldBegin(OutputStream result) throws IOException 
    {
        result.write(OPEN_GROUP);
        result.write(FIELD);
        if(fieldDirty) result.write(FIELD_DIRTY);
        if(fieldEdit) result.write(FIELD_EDIT);
        if(fieldLocked) result.write(FIELD_LOCKED);
        if(fieldPrivate) result.write(FIELD_PRIVATE);
    }
489289
function createWriteStream (path, options) {
    // build meta data
    var metadata = {}
    // get content type for file
    var contentType = mimeTypes.lookup(path)
    // set content type if found
    if (contentType) {
        metadata.contentType = contentType
    }
    // make sure bucket exists
    return this.bucketExists().then(() => {
        // create file write stream
        return this.bucket.file(path).createWriteStream({
            gzip: this.defaultGzip,
            metadata: metadata,
            public: this.defaultPublic,
            resumable: false,
        })
    })
}
28206
@Override
	public void streamBundleTo(String bundlePath, OutputStream out) throws ResourceNotFoundException {

		// Remove prefix, which are used only in production mode
		String path = PathNormalizer.removeVariantPrefixFromPath(bundlePath);
		ReadableByteChannel data = null;
		try {
			if (liveProcessBundles.contains(path)) {

				Reader rd = null;
				try {
					rd = resourceBundleHandler.getResourceBundleReader(path);
					StringReader strRd = processInLive(rd);
					StringWriter strWriter = new StringWriter();
					IOUtils.copy(strRd, strWriter);

					ByteArrayOutputStream bos = new ByteArrayOutputStream();
					try (GZIPOutputStream gzOut = new GZIPOutputStream(bos)) {
						byte[] byteData = strWriter.getBuffer().toString().getBytes(config.getResourceCharset().name());
						gzOut.write(byteData, 0, byteData.length);
					}
					ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
					data = Channels.newChannel(bis);
				} finally {
					IOUtils.close(rd);
				}

			} else {
				data = resourceBundleHandler.getResourceBundleChannel(path);
			}

			WritableByteChannel outChannel = Channels.newChannel(out);
			IOUtils.copy(data, outChannel);

		} catch (IOException e) {
			throw new BundlingProcessException("Unexpected IOException writing bundle [" + path + "]", e);
		} finally {
			IOUtils.close(data);
		}
	}
211468
private void writeObject(ObjectOutputStream oos) throws IOException
   {
      ObjectOutputStream.PutField fields =  oos.putFields();
      String name = serialPersistentFields[TYPE_IDX].getName();
      fields.put(name, type);
      name = serialPersistentFields[WORK_IDX].getName();
      fields.put(name, work);
      name = serialPersistentFields[EXCPEPTION_IDX].getName();
      fields.put(name, e);
      name = serialPersistentFields[DURATION_IDX].getName();
      fields.put(name, startDuration);
      oos.writeFields();
   }
1006252
public static void writeObject(CodedOutputStream out, int order, FieldType type, Object o, boolean list)
            throws IOException {
        writeObject(out, order, type, o, list, true);
    }
293498
private void writeObject(ObjectOutputStream stream) throws IOException {
		final Object[] lList = this.listeners;
		stream.defaultWriteObject();

		// Save the non-null event listeners:
		for (int i = 0; i < lList.length; i += 2) {
			final Class<?> t = (Class<?>) lList[i];
			final EventListener l = (EventListener) lList[i + 1];
			if ((l != null) && (l instanceof Serializable)) {
				stream.writeObject(t.getName());
				stream.writeObject(l);
			}
		}

		stream.writeObject(null);
	}
665518
def put_stream(self, bucket, label, stream_object, params={}):
        '''  '''
        self.claim_bucket(bucket) 
        self.connection.put_object(bucket, label, stream_object,
                                   headers=self._convert_to_meta(params))
751234
private void writeObject(ObjectOutputStream out) throws IOException {
        out.defaultWriteObject();
        // If the SemanticSpace that was provided is already serializable, then
        // just write it to the stream as is
        if (sspace instanceof Serializable) {
            out.writeObject(sspace);
        }
        // Otherwise, in order to serialize this instance, wrap the data in a
        // dummy SemanticSpace that contains the equivalent term-vector mapping
        else {
            verbose(LOGGER, "%s is not serializable, so writing a copy " +
                    "of the data", sspace.getSpaceName());
            Map<String,Vector> termToVector = 
                new HashMap<String,Vector>(sspace.getWords().size());
            for (String term : sspace.getWords()) 
                termToVector.put(term, sspace.getVector(term));
            SemanticSpace copy = new VectorMapSemanticSpace<Vector>(
                termToVector, "copy of " + sspace.getSpaceName(),
                sspace.getVectorLength());
            out.writeObject(copy);
        }
    }
195833
def write(gmt, out_path):
    
    with open(out_path, 'w') as f:
        for _, each_dict in enumerate(gmt):
            f.write(each_dict[SET_IDENTIFIER_FIELD] + '\t')
            f.write(each_dict[SET_DESC_FIELD] + '\t')
            f.write('\t'.join([str(entry) for entry in each_dict[SET_MEMBERS_FIELD]]))
            f.write('\n')
675186
public void writeTo (@Nonnull @WillNotClose final OutputStream aOS) throws IOException
  {
    // we may only need to check if this is closed if we are working with a file
    // but we should force the habit of closing whether we are working with
    // a file or memory.
    if (!m_bClosed)
      throw new IOException ("This stream is not closed");

    if (isInMemory ())
    {
      m_aMemoryOS.writeTo (aOS);
    }
    else
    {
      final InputStream aIS = FileHelper.getInputStream (m_aOutputFile);
      StreamHelper.copyInputStreamToOutputStream (aIS, aOS);
    }
  }
141716
public void writeClassFile(OutputStream out, ClassSymbol c)
        throws IOException, PoolOverflow, StringOverflow {
        Assert.check((c.flags() & COMPOUND) == 0);
        databuf.reset();
        poolbuf.reset();
        signatureGen.reset();
        pool = c.pool;
        innerClasses = null;
        innerClassesQueue = null;
        bootstrapMethods = new LinkedHashMap<>();

        Type supertype = types.supertype(c.type);
        List<Type> interfaces = types.interfaces(c.type);
        List<Type> typarams = c.type.getTypeArguments();

        int flags;
        if (c.owner.kind == MDL) {
            flags = ACC_MODULE;
        } else {
            flags = adjustFlags(c.flags() & ~DEFAULT);
            if ((flags & PROTECTED) != 0) flags |= PUBLIC;
            flags = flags & ClassFlags & ~STRICTFP;
            if ((flags & INTERFACE) == 0) flags |= ACC_SUPER;
        }

        if (dumpClassModifiers) {
            PrintWriter pw = log.getWriter(Log.WriterKind.ERROR);
            pw.println();
            pw.println("CLASSFILE  " + c.getQualifiedName());
            pw.println("---" + flagNames(flags));
        }
        databuf.appendChar(flags);

        if (c.owner.kind == MDL) {
            PackageSymbol unnamed = ((ModuleSymbol) c.owner).unnamedPackage;
            databuf.appendChar(pool.put(new ClassSymbol(0, names.module_info, unnamed)));
        } else {
            databuf.appendChar(pool.put(c));
        }
        databuf.appendChar(supertype.hasTag(CLASS) ? pool.put(supertype.tsym) : 0);
        databuf.appendChar(interfaces.length());
        for (List<Type> l = interfaces; l.nonEmpty(); l = l.tail)
            databuf.appendChar(pool.put(l.head.tsym));
        int fieldsCount = 0;
        int methodsCount = 0;
        for (Symbol sym : c.members().getSymbols(NON_RECURSIVE)) {
            switch (sym.kind) {
            case VAR: fieldsCount++; break;
            case MTH: if ((sym.flags() & HYPOTHETICAL) == 0) methodsCount++;
                      break;
            case TYP: enterInner((ClassSymbol)sym); break;
            default : Assert.error();
            }
        }

        if (c.trans_local != null) {
            for (ClassSymbol local : c.trans_local) {
                enterInner(local);
            }
        }

        databuf.appendChar(fieldsCount);
        writeFields(c.members());
        databuf.appendChar(methodsCount);
        writeMethods(c.members());

        int acountIdx = beginAttrs();
        int acount = 0;

        boolean sigReq =
            typarams.length() != 0 || supertype.allparams().length() != 0;
        for (List<Type> l = interfaces; !sigReq && l.nonEmpty(); l = l.tail)
            sigReq = l.head.allparams().length() != 0;
        if (sigReq) {
            int alenIdx = writeAttr(names.Signature);
            if (typarams.length() != 0) signatureGen.assembleParamsSig(typarams);
            signatureGen.assembleSig(supertype);
            for (List<Type> l = interfaces; l.nonEmpty(); l = l.tail)
                signatureGen.assembleSig(l.head);
            databuf.appendChar(pool.put(signatureGen.toName()));
            signatureGen.reset();
            endAttr(alenIdx);
            acount++;
        }

        if (c.sourcefile != null && emitSourceFile) {
            int alenIdx = writeAttr(names.SourceFile);
            // WHM 6/29/1999: Strip file path prefix.  We do it here at
            // the last possible moment because the sourcefile may be used
            // elsewhere in error diagnostics. Fixes 4241573.
            //databuf.appendChar(c.pool.put(c.sourcefile));
            String simpleName = PathFileObject.getSimpleName(c.sourcefile);
            databuf.appendChar(c.pool.put(names.fromString(simpleName)));
            endAttr(alenIdx);
            acount++;
        }

        if (genCrt) {
            // Append SourceID attribute
            int alenIdx = writeAttr(names.SourceID);
            databuf.appendChar(c.pool.put(names.fromString(Long.toString(getLastModified(c.sourcefile)))));
            endAttr(alenIdx);
            acount++;
            // Append CompilationID attribute
            alenIdx = writeAttr(names.CompilationID);
            databuf.appendChar(c.pool.put(names.fromString(Long.toString(System.currentTimeMillis()))));
            endAttr(alenIdx);
            acount++;
        }

        acount += writeFlagAttrs(c.flags());
        acount += writeJavaAnnotations(c.getRawAttributes());
        acount += writeTypeAnnotations(c.getRawTypeAttributes(), false);
        acount += writeEnclosingMethodAttribute(c);
        if (c.owner.kind == MDL) {
            acount += writeModuleAttribute(c);
            acount += writeFlagAttrs(c.owner.flags() & ~DEPRECATED);
        }
        acount += writeExtraClassAttributes(c);

        poolbuf.appendInt(JAVA_MAGIC);

        if (c.owner.kind == MDL) {
            // temporarily overide to force use of v53 for module-info.class
            poolbuf.appendChar(0);
            poolbuf.appendChar(53);
        } else {
            poolbuf.appendChar(target.minorVersion);
            poolbuf.appendChar(target.majorVersion);
        }

        writePool(c.pool);

        if (innerClasses != null) {
            writeInnerClasses();
            acount++;
        }

        if (!bootstrapMethods.isEmpty()) {
            writeBootstrapMethods();
            acount++;
        }

        endAttrs(acountIdx, acount);

        poolbuf.appendBytes(databuf.elems, 0, databuf.length);
        out.write(poolbuf.elems, 0, poolbuf.length);

        pool = c.pool = null; // to conserve space
     }
1182865
private void writeObject(java.io.ObjectOutputStream out)
                    throws IOException
    {
        out.defaultWriteObject();
        // write out the header information
        out.write(eyecatcher);
        out.writeShort(platform);
        out.writeShort(versionID);
        // write out the data
        out.writeObject(server);
        out.writeObject(wrappers);
        out.writeBoolean(exhausted);
        out.writeInt(chunkSize);
        out.writeInt(itrIndex);
        // This is no need to stream out parentCollection & collectionExceptionPending
    }