! @brief Write a single memory location.
        
        By default the transfer size is a word.
180267
def write_memory(self, addr, data, transfer_size=32):
        
        assert transfer_size in (8, 16, 32)
        if transfer_size == 32:
            self._link.write_mem32(addr, conversion.u32le_list_to_byte_list([data]), self._apsel)
        elif transfer_size == 16:
            self._link.write_mem16(addr, conversion.u16le_list_to_byte_list([data]), self._apsel)
        elif transfer_size == 8:
            self._link.write_mem8(addr, [data], self._apsel)
998634
def writeEntry(bs)
      return if not @dirty
      cluster = @parentCluster; offset = @parentOffset
      buf = bs.getCluster(cluster)
      if @lfn_ents
        @lfn_ents.each {|ent|
          buf[offset...(offset + DIR_ENT_SIZE)] = BinaryStruct.encode(ent, DIR_ENT_LFN)
          offset += DIR_ENT_SIZE
          if offset >= bs.bytesPerCluster
            bs.putCluster(cluster, buf)
            cluster, buf = bs.getNextCluster(cluster)
            offset = 0
          end
        }
      end
      buf[offset...(offset + DIR_ENT_SIZE)] = BinaryStruct.encode(@dir_ent, DIR_ENT_SFN)
      bs.putCluster(cluster, buf)
      @dirty = false
    end
784770
function StaticWriter(size) {
  if (!(this instanceof StaticWriter))
    return new StaticWriter(size);

  this.data = size ? Buffer.allocUnsafe(size) : EMPTY;
  this.offset = 0;
}
302749
def write(self, s):
        
        if self.comptype == "gz":
            self.crc = self.zlib.crc32(s, self.crc)
        self.pos += len(s)
        if self.comptype != "tar":
            s = self.cmp.compress(s)
        self.__write(s)
1296163
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
        // Write out capacity and any hidden stuff
        s.defaultWriteObject();
    }
1082287
private void writeToFile(MemoryCommitResult mcr) {
        // Rename the current file so it may be used as a backup during the next read
        if (mFile.exists()) {
            if (!mcr.changesMade) {
                // If the file already exists, but no changes were
                // made to the underlying map, it's wasteful to
                // re-write the file.  Return as if we wrote it
                // out.
                mcr.setDiskWriteResult(true);
                return;
            }
            if (!mBackupFile.exists()) {
                if (!mFile.renameTo(mBackupFile)) {
                    System.out.println( "Couldn't rename file " + mFile
                            + " to backup file " + mBackupFile);
                    mcr.setDiskWriteResult(false);
                    return;
                }
            } else {
                mFile.delete();
            }
        }

        // Attempt to write the file, delete the backup and return true as atomically as
        // possible.  If any exception occurs, delete the new file; next time we will restore
        // from the backup.
        try {
            FileOutputStream str = createFileOutputStream(mFile);
            if (str == null) {
                mcr.setDiskWriteResult(false);
                return;
            }
            XmlUtils.writeMapXml(mcr.mapToWriteToDisk, str);
            FileUtils.sync(str);
            str.close();
            setFilePermissionsFromMode(mFile.getPath(), mMode, 0);
            if (mFile.canRead()) {
                synchronized (this) {
                    mStatTimestamp = mFile.lastModified();
                    mStatSize = mFile.length();
                }
            }
            // Writing was successful, delete the backup file if there is one.
            mBackupFile.delete();
            mcr.setDiskWriteResult(true);
            return;
        } catch (IOException e) {
            System.out.println("writeToFile: Got exception:" + e);
        }
        // Clean up an unsuccessfully written file
        if (mFile.exists()) {
            if (!mFile.delete()) {
                System.out.println("Couldn't clean up partially-written file " + mFile);
            }
        }
        mcr.setDiskWriteResult(false);
    }
284855
def write(self, address, size, value):
        
        for i in range(0, size):
            self.__write_byte(address + i, (value >> (i * 8)) & 0xff)
984673
def write(self, buffer=bytes(), address=0, count=0):
        
        view = memoryview(self._cache)
        view[address:address + count] = buffer
1230260
private int writeAtMost(byte[] b, int off, int len) throws IOException {
    if (this.curr_ >= this.hi_) {
      if (this.hitEOF_ && this.hi_ < this.maxHi_) {
        // at EOF -- bump "hi"
        this.hi_ = this.maxHi_;
      } else {
        // slow path -- write current buffer; read next one
        this.seek(this.curr_);
        if (this.curr_ == this.hi_) {
          // appending to EOF -- bump "hi"
          this.hi_ = this.maxHi_;
        }
      }
    }
    len = Math.min(len, (int) (this.hi_ - this.curr_));
    int buffOff = (int) (this.curr_ - this.lo_);
    System.arraycopy(b, off, this.buff_, buffOff, len);
    this.curr_ += len;
    return len;
  }
244022
public void write(byte[] b,int offset, int length)
        throws IOException
    {
        ensureSpareCapacity(length);
        System.arraycopy(b,offset,_buf,_pos,length);
        _pos+=length;
    }
446969
private int write1(byte b[], int off, int len) throws IOException {
    eventStartWrite();

    try {
      if(count==0 && bytesSentInChunk + len>=buf.length) {
        // local buffer is empty and user data can fill the current chunk
        // checksum and output data
        final int length = buf.length - bytesSentInChunk;
        sum.update(b, off, length);
        writeChecksumChunk(b, off, length, false);
        // start a new chunk
        bytesSentInChunk = 0;
        return length;
      }
    
      // copy user data to local buffer
      int bytesToCopy = buf.length - bytesSentInChunk - count;
      bytesToCopy = (len<bytesToCopy) ? len : bytesToCopy;
      sum.update(b, off, bytesToCopy);
      System.arraycopy(b, off, buf, count, bytesToCopy);
      count += bytesToCopy;
      if (count + bytesSentInChunk == buf.length) {
        // local buffer is full
        flushBuffer(true, shouldKeepPartialChunkData());
      } 
      return bytesToCopy;
    } finally {
      eventEndWrite();
    }
  }
1083421
def write_to_memory
      len = Vips::SizeStruct.new
      ptr = Vips::vips_image_write_to_memory self, len

      # wrap up as an autopointer
      ptr = FFI::AutoPointer.new(ptr, GLib::G_FREE)

      ptr.get_bytes 0, len[:value]
    end
722140
def write(self, i, value):
        
        # Current byte position - (n * data_size)
        offset = i * self.__strct.size

        # Set file pointer to -(#data)
        self.__file.seek(offset)

        # Pack value
        data = self.pack(value)

        # Write packed value
        self.__file.write(data)
1017253
private void writeTag() {
        if (dataPos == dataSize)
            return;
        int tag = data[dataPos++];
        if (isEOC(tag) && (data[dataPos] == 0)) {
            dataPos++;  // skip length
            writeTag();
        } else
            newData[newDataPos++] = (byte)tag;
    }
475928
private void writeLocalSymbolTable(SymbolTable symTab)
    {
        assert symTab.isLocalTable();

        final int originalOffset = myBuffer.length - myOffset;

        // Write declared local symbol strings if any exists
        writeSymbolsField(symTab);

        // Write import declarations if any exists
        writeImportsField(symTab);

        // Write the struct prefix
        writePrefix(TYPE_STRUCT, myBuffer.length - myOffset - originalOffset);

        // Write the $ion_symbol_table annotation
        byte[] ionSymbolTableByteArray = {
               (byte) (0x80 | 1),                       /* annot-length */
               (byte) (0x80 | ION_SYMBOL_TABLE_SID)     /* annot */
               };
        writeBytes(ionSymbolTableByteArray);
        writePrefix(TYPE_ANNOTATIONS,
                    myBuffer.length - myOffset - originalOffset);
    }
183096
private int writeAtMost(ByteBuffer 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
        ByteBufferUtil.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;
    }
897772
private static void writeLEShort(OutputStream out, short s) throws IOException {
		out.write((byte)s);
		out.write((byte)((s >> 8) & 0xFF));
	}