Write the specified byte value to the IODIR registor.  If no value
        specified the current buffered value will be written.
9419
def _write_iodir(self, iodir=None):
        
        if iodir is not None:
            self.iodir = iodir
        self.i2c.write_list(self.IODIR, self.iodir)
237579
private void write(final byte memAddr, final int value) throws IOException {

		// bit 8 of value
		byte firstBit = (byte) ((value >> 8) & 0x000001);

		// ask device for setting a value - see FIGURE 7-2
		byte cmd = (byte) ((memAddr << 4) | CMD_WRITE | firstBit);

		// 7 bits of value
		byte data = (byte) (value & 0x00FF);

		// write sequence of cmd and data to the device
		byte[] sequence = new byte[] { cmd, data };
		i2cDevice.write(sequence, 0, sequence.length);

	}
942229
public void writeRawBytes(final ByteString value, int offset, int length)
                            throws IOException {
    if (limit - position >= length) {
      // We have room in the current buffer.
      value.copyTo(buffer, offset, position, length);
      position += length;
    } else {
      // Write extends past current buffer.  Fill the rest of this buffer and
      // flush.
      final int bytesWritten = limit - position;
      value.copyTo(buffer, offset, position, bytesWritten);
      offset += bytesWritten;
      length -= bytesWritten;
      position = limit;
      refreshBuffer();

      // Now deal with the rest.
      // Since we have an output stream, this is our buffer
      // and buffer offset == 0
      if (length <= limit) {
        // Fits in new buffer.
        value.copyTo(buffer, offset, 0, length);
        position = length;
      } else {
        // Write is very big, but we can't do it all at once without allocating
        // an a copy of the byte array since ByteString does not give us access
        // to the underlying bytes. Use the InputStream interface on the
        // ByteString and our buffer to copy between the two.
        InputStream inputStreamFrom = value.newInput();
        if (offset != inputStreamFrom.skip(offset)) {
          throw new IllegalStateException("Skip failed? Should never happen.");
        }
        // Use the buffer as the temporary buffer to avoid allocating memory.
        while (length > 0) {
          int bytesToRead = Math.min(length, limit);
          int bytesRead = inputStreamFrom.read(buffer, 0, bytesToRead);
          if (bytesRead != bytesToRead) {
            throw new IllegalStateException("Read failed? Should never happen");
          }
          output.write(buffer, 0, bytesRead);
          length -= bytesRead;
        }
      }
    }
  }
1185392
public void writeShort(int value) {
		try {
			buffer.writeInt(2);
			buffer.writeShort(value);
		} catch (Exception e) {
			throw new BinaryWriteFailedException(e);
		}
	}
409146
def write(self, addr, data):
        '''

        '''
        self.set_addr(addr & 0xfe)
        self.set_data(data)
        self.set_size(len(data))
        self.start()
        while not self.is_ready:
            pass
1220590
public void writeBytes(byte[] buffer, int offset, int length)
        throws IOException
    {
        if (buffer == null) {
            os.write('N');
        }
        else {
            while (length > 0x8000) {
                int sublen = 0x8000;

                os.write('b');
                os.write(sublen >> 8);
                os.write(sublen);

                os.write(buffer, offset, sublen);

                length -= sublen;
                offset += sublen;
            }

            os.write('B');
            os.write(length >> 8);
            os.write(length);
            os.write(buffer, offset, length);
        }
    }
434854
public static void writeMediumInt(IoBuffer out, int value) {
        byte[] bytes = new byte[3];
        bytes[0] = (byte) ((value >>> 16) & 0x000000FF);
        bytes[1] = (byte) ((value >>> 8) & 0x000000FF);
        bytes[2] = (byte) (value & 0x00FF);
        out.put(bytes);
    }
1348693
def _write_register(self, reg, value):
        """"""
        self.buf[0] = reg
        self.buf[1] = (value >> 8) & 0xFF
        self.buf[2] = value & 0xFF
        with self.i2c_device as i2c:
            i2c.write(self.buf)
1288873
public void writeDirect ( byte[] b, int off, int len, int flags ) throws IOException {
        if ( len <= 0 ) {
            return;
        }

        if ( this.tmp == null ) {
            throw new IOException("Bad file descriptor");
        }

        try ( SmbFileHandleImpl fh = ensureOpen();
              SmbTreeHandleImpl th = fh.getTree() ) {
            if ( log.isDebugEnabled() ) {
                log.debug("write: fid=" + fh + ",off=" + off + ",len=" + len);
            }

            int w;
            do {
                int blockSize = ( this.file.getType() == SmbConstants.TYPE_FILESYSTEM ) ? this.writeSizeFile : this.writeSize;
                w = len > blockSize ? blockSize : len;

                if ( this.smb2 ) {
                    Smb2WriteRequest wr = new Smb2WriteRequest(th.getConfig(), fh.getFileId());
                    wr.setOffset(this.fp);
                    wr.setData(b, off, w);

                    Smb2WriteResponse resp = th.send(wr, RequestParam.NO_RETRY);
                    long cnt = resp.getCount();
                    this.fp += cnt;
                    len -= cnt;
                    off += cnt;
                }
                else if ( this.useNTSmbs ) {
                    this.reqx.setParam(fh.getFid(), this.fp, len - w, b, off, w);
                    if ( ( flags & 1 ) != 0 ) {
                        this.reqx.setParam(fh.getFid(), this.fp, len, b, off, w);
                        this.reqx.setWriteMode(0x8);
                    }
                    else {
                        this.reqx.setWriteMode(0);
                    }

                    th.send(this.reqx, this.rspx, RequestParam.NO_RETRY);
                    long cnt = this.rspx.getCount();
                    this.fp += cnt;
                    len -= cnt;
                    off += cnt;
                }
                else {
                    if ( log.isTraceEnabled() ) {
                        log.trace(String.format("Wrote at %d remain %d off %d len %d", this.fp, len - w, off, w));
                    }
                    this.req.setParam(fh.getFid(), this.fp, len - w, b, off, w);
                    th.send(this.req, this.rsp);
                    long cnt = this.rsp.getCount();
                    this.fp += cnt;
                    len -= cnt;
                    off += cnt;
                    if ( log.isTraceEnabled() ) {
                        log.trace(String.format("Wrote at %d remain %d off %d len %d", this.fp, len - w, off, w));
                    }
                }

            }
            while ( len > 0 );
        }
    }
1320546
protected synchronized void write(int b) throws IOException {
		if (closed) {
			throw new IOException("The buffer is closed");
		}

		verifyBufferSize(1);
		buf[writepos] = (byte) b;
		writepos++;

		notifyAll();
	}
1341366
public void write(byte[] buf, int off, int len) throws IOException {
    // This could of course be optimized
    for (int i = 0; i < len; i++) {
      write(buf[off + i]);
    }
  }
490302
public void writeTo( WritableByteChannel channel ) throws IOException {
        int numberOfBytesToWrite = size;
        for (ByteBuffer buffer : buffers) {
            if (buffer == null) {
                // already flushed
                continue;
            }
            int numBytesInBuffer = Math.min(numberOfBytesToWrite, bufferSize);
            buffer.position(numBytesInBuffer);
            buffer.flip();
            channel.write(buffer);
            numberOfBytesToWrite -= numBytesInBuffer;
        }
        buffers.clear();
    }
766933
public void writeRawBytes(final byte[] value, int offset, int length)
                            throws IOException {
    if (limit - position >= length) {
      // We have room in the current buffer.
      System.arraycopy(value, offset, buffer, position, length);
      position += length;
    } else {
      // Write extends past current buffer.  Fill the rest of this buffer and
      // flush.
      final int bytesWritten = limit - position;
      System.arraycopy(value, offset, buffer, position, bytesWritten);
      offset += bytesWritten;
      length -= bytesWritten;
      position = limit;
      refreshBuffer();

      // Now deal with the rest.
      // Since we have an output stream, this is our buffer
      // and buffer offset == 0
      if (length <= limit) {
        // Fits in new buffer.
        System.arraycopy(value, offset, buffer, 0, length);
        position = length;
      } else {
        // Write is very big.  Let's do it all at once.
        output.write(value, offset, length);
      }
    }
  }
979796
public void write(ByteCodeWriter out)
    throws IOException
  {
    out.writeUTF8Const(getName());
    out.writeInt(_value.length);
    out.write(_value, 0, _value.length);
  }
866167
def write(self, arg, **kwargs):
        """"""
        if hasattr(arg, 'seek'):
            self._tofile(arg, **kwargs)
        else:
            with open(arg, 'wb') as fid:
                self._tofile(fid, **kwargs)
644258
private void writeBufferedData() throws IOException {
        if (buffer.length() > 0) {
            out.write(formatMessage(buffer.toString()).getBytes());
            out.write('\n');
            buffer = new StringBuffer();
        }
    }
1301383
@Override
    public void write(int data) throws IOException {
        ensureBufferAvailable();
        buffer.backingBuffer().put((byte) data);
        if (!buffer.hasRemaining()) {
            flush(false);
        }
    }