syck_emitter_write
514453
public void write(Pointer _str, final int _len) {
        int len = _len;
        byte[] bstr = _str.buffer;
        int str = _str.start;

        if(this.buffer == null) {
            clear();
        }

        int at = this.marker;
        if(len + at >= this.bufsize - 1) {
            flush(0);
            for(;;) {
                int rest = (this.bufsize - 1) - this.marker;
                if(len <= rest) break;
                System.arraycopy(bstr, str, this.buffer, this.marker, rest);
                this.marker += rest;
                str += rest;
                len -= rest;
                flush(0);
            }
        }
        
        System.arraycopy(bstr, str, this.buffer, this.marker, len);
        this.marker += len;
        this.buffer[this.marker] = 0;
    }
546906
def write_memory(addr, buf, progress=None, progress_addr=0, progress_size=0):
    

    xfer_count = 0
    xfer_bytes = 0
    xfer_total = len(buf)
    xfer_base = addr

    while xfer_bytes < xfer_total:
        if __verbose and xfer_count % 512 == 0:
            print ("Addr 0x%x %dKBs/%dKBs..." % (xfer_base + xfer_bytes,
                                                 xfer_bytes // 1024,
                                                 xfer_total // 1024))
        if progress and xfer_count % 2 == 0:
            progress(progress_addr, xfer_base + xfer_bytes - progress_addr,
                     progress_size)

        # Set mem write address
        set_address(xfer_base+xfer_bytes)

        # Send DNLOAD with fw data
        chunk = min(__cfg_descr.wTransferSize, xfer_total-xfer_bytes)
        __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 2, __DFU_INTERFACE,
                            buf[xfer_bytes:xfer_bytes + chunk], __TIMEOUT)

        # Execute last command
        if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY:
            raise Exception("DFU: write memory failed")

        # Check command state
        if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE:
            raise Exception("DFU: write memory failed")

        xfer_count += 1
        xfer_bytes += chunk
586324
private void writeImport(SymbolTable symTab)
    {
        assert symTab.isSharedTable();

        final int originalOffset = myBuffer.length - myOffset;

        // Write the maxId as int
        int maxId = symTab.getMaxId();
        if (maxId == 0) {
            writeByte((byte) TYPE_POS_INT);
        } else {
            writeUInt(maxId);
            writePrefix(TYPE_POS_INT,
                        myBuffer.length - myOffset - originalOffset);
        }

        // Write the "max_id" field name
        writeByte((byte) (0x80 | MAX_ID_SID));

        final int maxIdOffset = myBuffer.length - myOffset;

        // Write the version as int (version will be at least one)
        int version = symTab.getVersion();
        writeUInt(version);
        writePrefix(TYPE_POS_INT, myBuffer.length - myOffset - maxIdOffset);

        // Write the "version" field name
        writeByte((byte) (0x80 | VERSION_SID));

        // Write the name as string
        String name = symTab.getName();
        writeIonStringContent(name);

        // Write the "name" field name
        writeByte((byte) (0x80 | NAME_SID));

        // Write the struct prefix
        writePrefix(TYPE_STRUCT, myBuffer.length - myOffset - originalOffset);
    }
1103160
def write(self, text, fg='black', bg='white'):
        ''''''
        if isinstance(text, str):
            sys.stdout.write(text)
        else:
            sys.stdout.write(str(text))
        sys.stdout.flush()
1147830
def write(self, data, echo=None):
        

        if echo or (echo is None and self.echo):
            sys.stdout.write(data.decode('latin1'))
            sys.stdout.flush()
        self.channel.write(data)
1055143
def _write(self, s):
        """"""
        try:
            write = self.sock.write
        except AttributeError:
            # Works around a bug in python socket library
            raise IOError('Socket closed')
        else:
            while s:
                n = write(s)
                if not n:
                    raise IOError('Socket closed')
                s = s[n:]
298478
def write(self, memory, addr, data, flush_queue=False):
        """"""
        wreq = _WriteRequest(memory, addr, data, self.cf)
        if memory.id not in self._write_requests:
            self._write_requests[memory.id] = []

        # Workaround until we secure the uplink and change messages for
        # mems to non-blocking
        self._write_requests_lock.acquire()
        if flush_queue:
            self._write_requests[memory.id] = self._write_requests[
                memory.id][:1]
        self._write_requests[memory.id].insert(len(self._write_requests), wreq)
        if len(self._write_requests[memory.id]) == 1:
            wreq.start()
        self._write_requests_lock.release()

        return True
1065393
public void handle(Emitter emitter, byte[] str, int len) {
        YEmitter.Extra bonus = (YEmitter.Extra)emitter.bonus;
        IRubyObject dest = bonus.port;
        if(dest instanceof RubyString) {
            ((RubyString)dest).cat(new ByteList(str, 0, len, false));
        } else {
            dest.callMethod(runtime.getCurrentContext(), "write", RubyString.newStringShared(runtime, str, 0, len));
        }
    }
461563
def write(s)
      if idle_timeout
        if (t=Time.now) > @last_write + idle_timeout
          @socket.close rescue nil
          connect
        else
          @last_write = t
        end
      end
      begin
        retry_id ||= 0
        do_write(s)
      rescue => e
        if (retry_id += 1) < @retries
          @socket.close rescue nil
          connect
          retry
        else
          raise e
        end
      end
    end
312505
def _net_write(sock, data, expiration):
    
    current = 0
    l = len(data)
    while current < l:
        _wait_for_writable(sock, expiration)
        current += sock.send(data[current:])
1345127
def write(self, buf):
        """"""
        return self.transport_sock.sendto(
            buf,
            (self.transport_host, self.transport_port)
        )
749308
def write_data(self, buf):
        
        if self.hid.write(buf) != len(buf):
            raise IOError(
                'pywws.device_cython_hidapi.USBDevice.write_data failed')
        return True
833978
function write(buffer) {

    // first, trim trailing whitespace for fast searching
    buffer = buffer.replace(/[ \t]+$/gm, '')

    // compact lines if emptyLines != -1
    if (_elines >= 0)
      buffer = trimBuffer(buffer)

    if (!buffer) return

    // finished the surrounding lines, now the inners
    if (!_elines) {
      // remove empty lines and change eols in one unique operation
      buffer = buffer.replace(/\n{2,}/g, _to)
    }
    else {
      // keep max n empty lines (n+1 sucesive eols), -1 keep all
      if (_elines > 0)
        buffer = buffer.replace(_re, '$1')

      // change line terminator if not unix
      if (_to !== '\n') buffer = buffer.replace(/\n/g, _to)
    }

    // apply indentation, regex `^.` with `/m` matches non-empty lines
    if (_indent)
      buffer = buffer.replace(/^./mg, _indent + '$&')

    _lastch = buffer.slice(-1)
    // istanbul ignore else
    if (output)
      output.emit('data', buffer)
  }
564701
def write_data(self, data):
        """"""
        # send data
        for ptr, value in data:
            self._write_byte(ptr, value)
        # set 'data changed'
        self._write_byte(self.fixed_format['data_changed'][0], 0xAA)
        # wait for station to clear 'data changed'
        while True:
            ack = _decode(
                self._read_fixed_block(0x0020), self.fixed_format['data_changed'])
            if ack == 0:
                break
            logger.debug('write_data waiting for ack')
            time.sleep(6)
1019624
function fsWrite(fd, buffer, position, callback) {
  var offset = 0,
      length = buffer.length;

  function writeChunk() {
    fs.write(fd, buffer, offset, length - offset, position, function (err, bytesWritten) {
      if (err) { callback(err); return; }
      offset += bytesWritten;
      if (offset < length) {
        writeChunk();
        return;
      }
      callback();
    });
  }
  writeChunk();
}
1277071
def write(self, *args):
        '''
        '''
        for s in args: self.out.write(s)
        event = ''.join(*args)
829177
function _write (chunk, encoding, callback) {
  /* istanbul ignore else */
  if (Array.isArray(this.options.input.buffer)) {
    /* istanbul ignore else */
    if (is.buffer(chunk)) {
      if (this.options.input.buffer.length === 0) {
        const that = this;
        this.on('finish', function () {
          that.streamInFinished = true;
        });
      }
      this.options.input.buffer.push(chunk);
      callback();
    } else {
      callback(new Error('Non-Buffer data on Writable Stream'));
    }
  } else {
    callback(new Error('Unexpected data on Writable Stream'));
  }
}