Write parameter to output file (and possibly screen).

@param toWrite Text to write to file
761554
protected void write(String toWrite) throws IOException  {
    if(!okToWrite)
      throw new IOException("file not open for writing.");

    if(printToScreen)
      System.out.print(toWrite);

    try {
      fw.write(toWrite);
    } catch (IOException e) {
      okToWrite = false;
      throw e;
    }
  }
1322575
public static void writeObjectToFile(String path, Object toWrite, JavaSparkContext sc) throws IOException {
        writeObjectToFile(path, toWrite, sc.sc());
    }
1080396
def _write(self, session, openFile, replaceParamFile):
        
        # Write lines
        openFile.write(text(self.projection))
1197240
@Override
    public void write(final File filename) throws DITAOTException {
        assert filename.isAbsolute();
        super.write(new File(currentFile));
    }
849914
private static void write0(Scriptable thisObj, Object[] args, boolean eol)
        throws IOException
    {
        File thisFile = checkInstance(thisObj);
        if (thisFile.reader != null) {
            throw Context.reportRuntimeError("already writing file \""
                                             + thisFile.name
                                             + "\"");
        }
        if (thisFile.writer == null)
            thisFile.writer = new BufferedWriter(
                thisFile.file == null ? new OutputStreamWriter(System.out)
                                      : new FileWriter(thisFile.file));
        for (int i=0; i < args.length; i++) {
            String s = Context.toString(args[i]);
            thisFile.writer.write(s, 0, s.length());
        }
        if (eol)
            thisFile.writer.newLine();
    }
405031
public void writeOutput(DataPipe cr) {
        try {
            context.write(NullWritable.get(), new Text(cr.getPipeDelimited(outTemplate)));
        } catch (Exception e) {
            throw new RuntimeException("Exception occurred while writing to Context", e);
        }
    }
37856
public static void toWriter(Node node, Writer writer) throws TransformerException {
		toWriter(node, writer, new HashMap<String, String>());
	}
1236567
protected void writeFile(String basename, T content,
			Function2<? super File, ? super String, ? extends File> outputDirectoryFilter) {
		// Create the file.
		// Encode
		final byte[] bytes = content.toString().getBytes(Charset.forName(getCodeConfig().getEncoding()));
		writeFile(basename, bytes, outputDirectoryFilter);
	}
1205325
private void writeToImpl(Writer out, String encoding, byte[] bufferToWrite, int bufferToWriteLen)
            throws IOException {
        String writeStr;
        if (encoding != null) {
            writeStr = new String(bufferToWrite, 0, bufferToWriteLen, encoding);
        } else {
            writeStr = new String(bufferToWrite, 0, bufferToWriteLen);
        }
        out.write(writeStr);
    }
1276320
public static void writeTextFile(String text,File file) throws IOException
    {
        Writer writer=null;
        try
        {
            //create writer to file (with default encoding)
            OutputStream outputStream=new FileOutputStream(file);
            writer=IOHelper.createWriter(outputStream,null);
            
            //write to file
            writer.write(text);
        }
        finally
        {
            //close writer
            IOHelper.closeResource(writer);
        }
    }
986147
@Override
  public void write(DataOutput out) throws IOException {
    Text.writeString(out, getJobId());
    out.writeDouble(getCpuUsageGHz());
    out.writeDouble(getMemUsageGB());
  }
1358426
private static void writeToFile(String text, String logFilePath, boolean isDetailed) {
        if (isSDCardAvailable() && isSDCardWritable() && text != null) {

            try {
                File file = new File(logFilePath);
                OutputStream os = new FileOutputStream(file, true);
                if (isDetailed) {
                    os.write(("---" + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS").format(Calendar.getInstance().getTime()) + "---\n").getBytes());
                }
                os.write((text + "\n").getBytes());
                // os.write(("------\n").getBytes());
                os.close();
            } catch (Exception e) {
                QuickUtils.log.e("Exception", e);
            }
        } else {
            return;
        }
    }
847549
public void write(String text) throws IOException {
        file.getParentFile().mkdirs();
        AtomicFileWriter w = new AtomicFileWriter(file);
        try {
            w.write(text);
            w.commit();
        } finally {
            w.abort();
        }
    }
715269
public void write(Writer out)
         throws IOException
    {
        out.write("<dl"+attributes()+">");

        if (terms.size() != defs.size())
            throw new Error("mismatched Vector sizes");

        for (int i=0; i <terms.size() ; i++)
        {
            out.write("<dt>");
            ((Element)terms.elementAt(i)).write(out);
            out.write("</dt><dd>");
            ((Element)defs.elementAt(i)).write(out);
            out.write("</dd>");
        }

        out.write("</dl>");
    }
21341
public void writeContent(final OutputStream result) throws IOException
    {
    	writeRowDefinition(result);
        
        for(int i = 0; i < this.cells.size(); i++) {
            RtfCell rtfCell = (RtfCell) this.cells.get(i);
            rtfCell.writeContent(result);
        }

        result.write(DELIMITER);

        if(this.document.getDocumentSettings().isOutputTableRowDefinitionAfter()) {
        	writeRowDefinition(result);
        }

        result.write(ROW_END);
        this.document.outputDebugLinebreak(result);
    }
374935
public static void writeArrayToDisk(INDArray arr, File toWrite) throws IOException {
        try (FileOutputStream os = new FileOutputStream(toWrite)) {
            FileChannel channel = os.getChannel();
            ByteBuffer buffer = BinarySerde.toByteBuffer(arr);
            channel.write(buffer);
        }
    }
163911
public boolean write(File targetFile) throws IORuntimeException {
		final String formatName = FileUtil.extName(targetFile);
		if (StrUtil.isNotBlank(formatName)) {
			this.targetImageType = formatName;
		}
		
		if(targetFile.exists()) {
			targetFile.delete();
		}
		
		ImageOutputStream out = null;
		try {
			out = ImgUtil.getImageOutputStream(targetFile);
			return write(out);
		} finally {
			IoUtil.close(out);
		}
	}