Write unbuffered data to the client.
1212
def write(self, chunk):
        """"""
        if self.chunked_write and chunk:
            chunk_size_hex = hex(len(chunk))[2:].encode('ascii')
            buf = [chunk_size_hex, CRLF, chunk, CRLF]
            self.conn.wfile.write(EMPTY.join(buf))
        else:
            self.conn.wfile.write(chunk)
859470
public void write() {
    // We record the start time to avoid spending too much time on writings
    long startOfCycle = System.nanoTime();
    long bytesWritten = 0;

    long nPacketsWritten = 0;

    while ((System.nanoTime() - startOfCycle - writeBatchTime.toNanos()) < 0
        && (bytesWritten < writeBatchSize.asBytes())) {
      OutgoingPacket outgoingPacket = outgoingPacketsToWrite.peek();
      if (outgoingPacket == null) {
        break;
      }

      int writeState = outgoingPacket.writeToChannel(socketChannel);
      if (writeState > 0) {
        // Partial writing, we would break since we could not write more data on socket.
        // But we have set the next start point of OutgoingPacket
        // Next time when the socket is writable, it will start from that point.
        break;
      } else if (writeState < 0) {
        LOG.severe("Something bad happened while writing to channel");
        selectHandler.handleError(socketChannel);
        return;
      } else {
        // writeState == 0, we fully write a outgoingPacket
        bytesWritten += outgoingPacket.size();
        nPacketsWritten++;

        outgoingPacketsToWrite.remove();
      }
    }

    totalPacketsWritten += nPacketsWritten;
    totalBytesWritten += bytesWritten;

    // Disable writing if there are nothing to send in buffer
    if (getOutstandingPackets() == 0) {
      disableWriting();
    }
  }
410337
public static void writeBuffer(DataOutput out, ByteBuffer buffer) throws IOException {
        if (buffer.hasArray()) {
            out.write(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining());
            buffer.position(buffer.limit());
        } else {
            final byte[] array = new byte[buffer.remaining()];
            buffer.get(array);
            assert buffer.remaining() == 0 && buffer.position() == buffer.limit();
            out.write(array);
        }
    }
727194
def flush(self):
        
        self._write_all(self._wbuffer.getvalue())
        self._wbuffer = BytesIO()
        return
605289
function write (buffer, cb) {
		if (isStopped) return false

		//test if we have to end
		//FIXME it should wait till all the data fed
		if (buffer == null) {
			callbackQueue.push(function () {
				end()
				cb && cb()
			})
			callbackMarks.push(count)
			return null
		}

		//push buffer
		if (!isAudioBuffer(buffer)) {
			buffer = createBuffer(buffer, {
				channels,
				context
			})
		}

		count += buffer.length
		data.append(buffer)

		//save callback
		if (cb) {
			callbackQueue.push(cb)
			callbackMarks.push(count)
		}

		return buffer
	}
750134
@Override
    public IoBufferEx write(IoBufferEx source, IoBufferAllocatorEx<?> allocator) {
        return writeChunked(source, allocator);
    }
981822
private void writeBuffer() throws IOException {
        bufferedWriter.flip(); // position is set to zero in dataFile.write
        dataFile.write(writeOffset, bufferedWriter);
        writeOffset += bufferedWriter.limit();
        bufferedWriter.clear();
        readNextChunkFromFile(); // before overwriting the next bucket. Read it.
    }
278535
def write_frame(self, buf):
        '''
        
        '''
        writer = Writer(buf)

        writer.write_octet(self.type()).\
            write_short(self.channel_id).\
            write_long(len(self._payload)).\
            write(self._payload).\
            write_octet(0xce)
1301383
@Override
    public void write(int data) throws IOException {
        ensureBufferAvailable();
        buffer.backingBuffer().put((byte) data);
        if (!buffer.hasRemaining()) {
            flush(false);
        }
    }
207718
public void write(byte[] buf, int offset, int length) throws IOException
    {
        if (length>_buffer.capacity())
            _flush=ByteBuffer.wrap(buf,offset,length);
        else
         {
             _buffer.clear();
             _buffer.put(buf,offset,length);
             _buffer.flip();
             _flush=_buffer;
         }
         flushBuffer();
    }
396626
async def write(self, data, eof = False, buffering = True):
        
        if not self.outputstream:
            self.outputstream = Stream()
            self._startResponse()
        elif (not buffering or eof) and not self._sendHeaders:
            self._startResponse()
        if not isinstance(data, bytes):
            data = data.encode(self.encoding)
        await self.outputstream.write(data, self.connection, eof, False, buffering)
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'));
  }
}
576854
def write(self, b: bytes) -> None:
        """"""
        if not isinstance(b, bytes):
            raise TypeError('a bytes-like object is required, not {}'.format(type(b)))
        if not self.std_sim_instance.pause_storage:
            self.byte_buf += b
        if self.std_sim_instance.echo:
            self.std_sim_instance.inner_stream.buffer.write(b)

            # Since StdSim wraps TextIO streams, we will flush the stream if line buffering is on
            # and the bytes being written contain a new line character. This is helpful when StdSim
            # is being used to capture output of a shell command because it causes the output to print
            # to the screen more often than if we waited for the stream to flush its buffer.
            if self.std_sim_instance.line_buffering:
                if any(newline in b for newline in ByteBuf.NEWLINES):
                    self.std_sim_instance.flush()
429243
def write(self, data):
        ''
        if not hasattr(data, 'read'):
            data = six.BytesIO(data)#StringIO(data)
        self.jfs.up(self.path, data)
930303
def write(data, timeout = @timeout)
      full_size = data.bytesize

      while data.bytesize > 0
        written = socket.write_nonblock(data, exception: false)

        if written == :wait_writable
          socket.wait_writable(timeout) or fail_with_timeout!
        else
          data = data.byteslice(written..-1)
        end
      end

      full_size
    end
4653
def _WritePartial(self, data):
    """"""

    chunk = self.offset // self.chunksize
    chunk_offset = self.offset % self.chunksize
    data = utils.SmartStr(data)

    available_to_write = min(len(data), self.chunksize - chunk_offset)

    fd = self._GetChunkForWriting(chunk)
    fd.seek(chunk_offset)

    fd.write(data[:available_to_write])
    self.offset += available_to_write

    return data[available_to_write:]
501814
private long write(long offset, ByteBuffer inputBuf) throws IOException {
    int inputBufLength = inputBuf.limit() - inputBuf.position();
    MappedByteBuffer outputBuf =
        mLocalFileChannel.map(FileChannel.MapMode.READ_WRITE, offset, inputBufLength);
    outputBuf.put(inputBuf);
    int bytesWritten = outputBuf.limit();
    BufferUtils.cleanDirectBuffer(outputBuf);
    return bytesWritten;
  }