Writes a stream to a file.

        :param stream:
            A BytesIO instance. ``bytes`` are also possible and are converted
            to BytesIO.

        :rtype: File
162269
def dump(self, stream=None):
        
        if stream is None:
            stream = BytesIO()

        if isinstance(stream, bytes):
            stream = BytesIO(stream)

        stream = self.codec.compress(stream)
        self.fs.dump(stream)

        return self
852168
def write(self, data):
        
        for _ in range(64 - len(data)):
            data.append(0)
        #logging.debug("send: %s", data)
        self.report.send(bytearray([0]) + data)
        return
74377
def log_to_stream(stream=sys.stderr, level=logging.NOTSET,
                  fmt=logging.BASIC_FORMAT):
    
    fmt = Formatter(fmt)
    handler = StreamHandler()
    handler.setFormatter(fmt)
    handler.setLevel(level)

    log.addHandler(handler)
563089
public static File copy(InputStream stream) throws IOException
  {
    File file = createTempFile();
    copy(stream, new FileOutputStream(file));
    return file;
  }
590156
public void write(InputStream stream) throws IOException {
        onNewLine = false;
        try (ReadableByteChannel readable = Channels.newChannel(stream)) {
            flush();
            while (readable.read(buffer) != -1) {
                flush();
            }
        }
    }
218439
def _write_bytes(stream: Union[StdSim, TextIO], to_write: bytes) -> None:
        
        try:
            stream.buffer.write(to_write)
        except BrokenPipeError:
            # This occurs if output is being piped to a process that closed
            pass
566039
def write(self, chunk: bytes) -> "Future[None]":
        
        future = None
        if self.stream.closed():
            future = self._write_future = Future()
            self._write_future.set_exception(iostream.StreamClosedError())
            self._write_future.exception()
        else:
            future = self._write_future = Future()
            self._pending_write = self.stream.write(self._format_chunk(chunk))
            future_add_done_callback(self._pending_write, self._on_write_complete)
        return future
667408
def write(self, word):
		
		self.repr_.setvalue(word)
		try:
			self.open_stream.write(chr(self.repr_.getvalue()))
		except OverflowError:
			self.open_stream.write("?")
314245
def write(self, stream):
        '''
        

        '''
        (must_close, stream) = _open_stream(stream, 'write')
        try:
            stream.write(self.header.encode('ascii'))
            stream.write(b'\n')
            for elt in self:
                elt._write(stream, self.text, self.byte_order)
        finally:
            if must_close:
                stream.close()
1356330
public static void save(Object o, OutputStream stream) {
        try {
            ObjectOutputStream outStream = 
                (stream instanceof ObjectOutputStream)
                    ? (ObjectOutputStream)stream
                    : new ObjectOutputStream(stream);
            outStream.writeObject(o);
        } catch (IOException ioe) {
            throw new IOError(ioe);
        }
    }
1107240
def binary_stream(stream):
    
    try:
        import os
        if os.name == 'nt':
            fileno = getattr(stream, 'fileno', None)
            if fileno:
                no = fileno()
                if no >= 0:     # -1 means we're working as subprocess
                    import msvcrt
                    msvcrt.setmode(no, os.O_BINARY)
    except ImportError:
        pass
    return stream
519428
def data_from_stream(self, stream):
        
        parser = self._make_representation_parser(stream, self.resource_class,
                                                  self._mapping)
        return parser.run()
4639
public void writeToStream(OutputStream os) throws IOException
  {
    if (_readLength <= _readOffset) {
      readBuffer();
    }

    while (_readOffset < _readLength) {
      os.write(_readBuffer, _readOffset, _readLength - _readOffset);

      readBuffer();
    }
  }
1339190
def openStream(self, source):
        
        # Already a file object
        if hasattr(source, 'read'):
            stream = source
        else:
            stream = BytesIO(source)

        try:
            stream.seek(stream.tell())
        except:  # pylint:disable=bare-except
            stream = BufferedStream(stream)

        return stream
177843
def _write_bin(self, stream, byte_order):
        '''
        

        '''
        for rec in self.data:
            for prop in self.properties:
                prop._write_bin(rec[prop.name], stream, byte_order)
1197952
def stream(self):
        """"""

        if not hasattr(self, '_stream'):
            if self.file is not None:
                self._stream = self.file
            elif self.filename is not None:
                self._stream = open(self.filename, 'rb')
            elif self.text is not None:
                self._stream = StringIO(self.text)
            elif self.data is not None:
                self._stream = BytesIO(self.data)
            else:
                raise ValueError('Broken Data, all None.')
        return self._stream
952473
def write(self, word):
		
		bytes_ = int_to_bytes(word, self.width)
		self.open_stream_out.write(bytes_)