Writes this JAR to a file.
351365
public File write(File file) throws IOException {
        try (FileOutputStream fos = new FileOutputStream(file)) {
            write(fos);
            return file;
        }
    }
89188
public void write(OutputStream out)
         throws IOException
    {
        Writer writer = new OutputStreamWriter(out);
        write(writer);
        writer.flush();
    }
1260636
private void writeBuffer() throws IOException {
    for (int pos = 0; pos < currentBufferSize; pos++) {
      if (isByte[pos]) {
        aFile.write((byte) buffer[pos]);
      } else {
        aFile.write(buffer[pos]);
      }
    }
  }
456969
void writeAssocBean() throws IOException {

    writingAssocBean = true;
    origDestPackage = destPackage;
    destPackage = destPackage + ".assoc";
    origShortName = shortName;
    shortName = "Assoc" + shortName;

    prepareAssocBeanImports();

    writer = new Append(createFileWriter());

    writePackage();
    writeImports();
    writeClass();
    writeFields();
    writeConstructors();
    writeClassEnd();

    writer.close();
  }
1038782
private void writeObject(ObjectOutputStream out) throws IOException {
        ClassRef.write(out, type);
        out.writeUTF(name);
        out.writeObject(val);
    }
1158258
public function write()
    {
        $data = array();
        $dumper = new ArrayDumper();

        foreach ($this->getCanonicalPackages() as $package) {
            $data[] = $dumper->dump($package);
        }

        $this->file->write($data);
    }
199764
public function Write()
    {
        file_put_contents(
            $this->file,
            \Peg\Lib\Utilities\Json::Encode($this->preferences)
        );
    }
906233
public void write() throws IOException
   {
      SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
      {
         public Object run() throws Exception
         {
            // do not write if not dirty
            if (!dirty)
            {
               return null;
            }

            OutputStream out = new IndexOutputStream(dir.createOutput(name + ".new"));
            DataOutputStream dataOut = null;
            try
            {
               dataOut = new DataOutputStream(out);
               dataOut.writeInt(counter);
               dataOut.writeInt(indexes.size());
               for (int i = 0; i < indexes.size(); i++)
               {
                  dataOut.writeUTF(getName(i));
               }
            }
            finally
            {
               if (dataOut != null)
                  dataOut.close();
               out.close();
            }
            // delete old
            if (dir.fileExists(name))
            {
               dir.deleteFile(name);
            }
            rename(name + ".new", name);
            dirty = false;
            return null;
         }
      });
   }
1183428
private void writeFile()
            throws IOException
    {
        LOGGER.debug( "Writing credentials file to {}", file );
        File tempFile = new File( file.getPath() + ".tmp" );

        Writer writer = null;
        try {
            writer = new OutputStreamWriter( new FileOutputStream( tempFile ), PcsUtils.UTF8 );

            for ( String key : credentialsMap.keySet() ) {
                Credentials cred = credentialsMap.get( key );
                final String line = key + "=" + cred.toJson() + "\n";
                writer.write( line );
            }
            writer.flush();

        } finally {
            PcsUtils.closeQuietly( writer );
        }

        file.delete();
        tempFile.renameTo( file );
    }
25074
public void writeToDisk() {
        if ( !initialized ) {
            initializeLog();
        }
        Writer writer = null;
        try {
            FileOutputStream fileOut = new FileOutputStream( this.fileName + (this.nbOfFile == 0 ? ".log" : this.nbOfFile + ".log" ),
                                                             true );
            writer = new OutputStreamWriter( fileOut,
                                             IoUtils.UTF8_CHARSET );
            final XStream xstream = createTrustingXStream();

            WorkingMemoryLog log = null;
            synchronized ( this.events ) {
                log = new WorkingMemoryLog(new ArrayList<LogEvent>( this.events ));
                clear();
            }
            writer.write( xstream.toXML( log ) + "\n" );
        } catch ( final FileNotFoundException exc ) {
            throw new RuntimeException( "Could not create the log file.  Please make sure that directory that the log file should be placed in does exist." );
        } catch ( final Throwable t ) {
            logger.error("error", t);
        } finally {
            if ( writer != null ) {
                try {
                    writer.close();
                } catch ( Exception e ) {
                }
            }
        }
        if ( terminate ) {
            closeLog();
            terminate = true;
        } else if ( split ) {
            closeLog();
            this.nbOfFile++;
            initialized = false;
        }
    }
12710
public void write(@WillClose OutputStream out) throws IOException {
        BufferedWriter writer = null;
        boolean missingClassWarningsSuppressed = AnalysisContext.currentAnalysisContext().setMissingClassWarningsSuppressed(true);

        try {
            writer = new BufferedWriter(new OutputStreamWriter(out, UTF8.charset));

            TreeSet<KeyType> sortedMethodSet = new TreeSet<>();
            sortedMethodSet.addAll(propertyMap.keySet());
            for (KeyType key : sortedMethodSet) {
                if (AnalysisContext.currentAnalysisContext().isApplicationClass(key.getClassDescriptor())) {

                    ValueType property = propertyMap.get(key);

                    writeKey(writer, key);
                    writer.write("|");
                    writer.write(encodeProperty(property));
                    writer.write("\n");
                }
            }
        } finally {
            AnalysisContext.currentAnalysisContext().setMissingClassWarningsSuppressed(missingClassWarningsSuppressed);

            try {
                if (writer != null) {
                    writer.close();
                }
            } catch (IOException e) {
                // Ignore
            }
        }
    }
91154
@Override
    public void writeCatalogJar(byte[] catalogBytes) throws IOException
    {
        File configInfoDir = getConfigDirectory();
        configInfoDir.mkdirs();

        InMemoryJarfile.writeToFile(catalogBytes,
                                    new VoltFile(configInfoDir.getPath(),
                                                 InMemoryJarfile.TMP_CATALOG_JAR_FILENAME));
    }
1010652
public void write(ByteBuffer buffer) throws IOException {
		synchronized (buffers) {
			if (writing == null) {
				writing = io.writeAsync(buffer);
				writing.listenInline(listener);
				return;
			}
			if (writing.hasError()) throw writing.getError();
			buffers.add(buffer);
		}
	}
23238
public void dump() throws IOException {
    FileWriter out = new FileWriter(outFile, true);
    try {
      dump(out);
    } finally {
      out.close();
    }
  }
93250
def write(self):
        
        if not os.path.isdir(self._dirs['source_dir']):
            os.mkdir(self._dirs['source_dir'])

        fout = codecs.open(self._dirs['source_filename'], 'w', encoding="utf-8", errors="xmlcharrefreplace")
        fout.write(self._config_to_text())
        if self._content:
            fout.write('\n')
            fout.write(self._content)
            fout.write('\n')
        fout.close()
325464
private void writeObject(ObjectOutputStream out) throws IOException {
        ClassRef.write(out, result);
        ClassRef.write(out, arg);
        out.writeUTF(name);
    }
1211369
static void writeClassToFile(String className, ClassWriter classWriter, String apiName){
        classWriter.visitEnd();

        byte[] constructedClass = classWriter.toByteArray();

        try (FileOutputStream os = new FileOutputStream(new File(getFinalPathPart(className, apiName)))){
            os.write(constructedClass);
        } catch (IOException e) {
            throw new AsmException("Exception while writing generated classes to the .class files.", e);
        }
    }