Writes from a String to a temporary file
515924
public static File writeToTempFile(String buf, String prefix, String suffix) throws IOException {

        InputStream is = new ByteArrayInputStream(buf.getBytes("UTF-8"));
        return writeToTempFile(is, prefix, suffix);
    }
171902
def write_string(self, value, length):
        """"""
        format = '!' + str(length) + 's'
        self.data.append(struct.pack(format, value))
        self.size += length
602789
public static void stringToFile(FileSystem fs, Path path, String string)
	    throws IOException {
		OutputStream os = fs.create(path, true);
		PrintWriter pw = new PrintWriter(os);
		pw.append(string);
		pw.close();
	}
678852
def write_string(self, string):
        
        buf = bytes(string, 'UTF-8')
        length = len(buf)
        self.write_int(length)
        self.write(buf)
175813
private int writeAtMost(byte[] data, int offset, int length)
    {
        if (current >= bufferOffset + buffer.length)
            reBuffer();

        assert current < bufferOffset + buffer.length
                : String.format("File (%s) offset %d, buffer offset %d.", getPath(), current, bufferOffset);


        int toCopy = Math.min(length, buffer.length - bufferCursor());

        // copy bytes from external buffer
        System.arraycopy(data, offset, buffer, bufferCursor(), toCopy);

        assert current <= bufferOffset + buffer.length
                : String.format("File (%s) offset %d, buffer offset %d.", getPath(), current, bufferOffset);

        validBufferBytes = Math.max(validBufferBytes, bufferCursor() + toCopy);
        current += toCopy;

        return toCopy;
    }
850047
def write (self, data):
        """"""
        assert isinstance(data, unicode)
        if self.closed:
            raise IOError("Write on closed I/O object")
        if data:
            self.buf.append(data)
470075
private void write(String str) {
        try {
            m_writer.write(str);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
27630
def write_to_local(self, filepath_from, filepath_to, mtime_dt=None):
        """"""

        self.__log.debug("Writing R[%s] -> L[%s]." % (filepath_from, 
                                                      filepath_to))

        with SftpFile(self, filepath_from, 'r') as sf_from:
            with open(filepath_to, 'wb') as file_to:
                while 1:
                    part = sf_from.read(MAX_MIRROR_WRITE_CHUNK_SIZE)
                    file_to.write(part)

                    if len(part) < MAX_MIRROR_WRITE_CHUNK_SIZE:
                        break

        if mtime_dt is None:
            mtime_dt = datetime.now()

        mtime_epoch = mktime(mtime_dt.timetuple())
        utime(filepath_to, (mtime_epoch, mtime_epoch))
572940
def write(self, string):
        """"""
        string = string.rstrip()
        if string:  # Don't log empty lines
            self.logger.critical(string)
837502
def write_json_to_temp_file(data):
    """"""
    fp = tempfile.NamedTemporaryFile(delete=False)
    fp.write(json.dumps(data).encode('utf-8'))
    fp.close()
    return fp.name
861857
def write(self, *string):
        
        self._output.write(' '.join([six.text_type(s) for s in string]))
        return self
289601
def _write_temp(content, suffix):
    ''''''
    with NamedTemporaryFile(mode='w', suffix=suffix, delete=False) as out:
        out.write(content)
        return out.name
644291
public static void writeTXT(String string, File file) throws IOException {
		BufferedWriter out = new BufferedWriter(new FileWriter(file));
		out.write(string);
		out.close();
	}
1370574
public void write(String s, int off, int len) throws IOException {
	    if (writer != null) {
	        writer.write(s, off, len);
	    } else {
	        ensureOpen();
	        //PK33136
	        strBuffer.append(s.substring(off, off+len));
	        nextChar += len;
	        //PK33136
	    }
    }
1277023
@Override
  public void write(byte []buf, int offset, int length, boolean isEnd)
    throws IOException
  {
    if (! _isPost) {
      return;
    }

    if (_tempStream == null) {
      _tempStream = new MemoryStream();
    }

    _tempStream.write(buf, offset, length, isEnd);
  }
1219233
public function fwrite($string, $length = null) {

        if($length === 0 || empty($string)) {

            return 0;
        }

        $return = ($length === null) ? fwrite($this->fileHandle, $string) : fwrite($this->fileHandle, $string, $length);

        if($return === false) {

            throw new TempFileException('Error writing to temp file.');
        }

        return $return;
    }
417399
def write_in_tmpfile(text, tmpfile):
        
        try:
            tmpfile.write(text)
        except TypeError:
            tmpfile.write(str.encode(text))
        except UnicodeEncodeError:
            tmpfile.write(text.encode("utf-8"))