Push the given bytes onto the stack file.
 @param bytes [String] Bytes to write.
978786
def push(bytes)
      if bytes.length != @entry_bytes
        PEROBS.log.fatal "All stack entries must be #{@entry_bytes} " +
          "long. This entry is #{bytes.length} bytes long."
      end
      begin
        @f.seek(0, IO::SEEK_END)
        @f.write(bytes)
      rescue => e
        PEROBS.log.fatal "Cannot push to stack file #{@file_name}: #{e.message}"
      end
    end
549938
public static void setBytes(File file, byte[] bytes) throws IOException {
        IOGroovyMethods.setBytes(new FileOutputStream(file), bytes);
    }
1196802
public void write(byte[] bytes) throws IOException {
        for (int i = 0; i < bytes.length; i++) {
            write(bytes[i]);
        }
    }
576374
public void write(byte[] b, int offset, int length)
        throws IOException
    {
        int o=offset;
        int l=length;
        while (l>0)
        {
            int c=capacity();
            
            if (_bypassBuffer && isCommitted() && size()==0 && l>c)
            {
                // Bypass buffer
                bypassWrite(b,o,l);
                break;
            }

            if (l<c || !isFixed())
            {
                // Write all
                super.write(b,o,l);
                break;
            }
            else
            {
                // Write a block
                super.write(b,o,c);
                flush();
                l-=c;
                o+=c;
            }
        }
    }
1117005
def pop(self, bytes):
        
        self.io.seek(0)
        head = self.io.read(bytes)
        tail = self.io.read()
        self.io.seek(0)
        self.io.write(tail)
        self.io.truncate()
        return head
1100317
public static void write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws IOException {
        Arrays.checkOffsetAndCount(bytes.length, byteOffset, byteCount);
        if (byteCount == 0) {
            return;
        }
        try {
            while (byteCount > 0) {
                int bytesWritten = Libcore.os.write(fd, bytes, byteOffset, byteCount);
                byteCount -= bytesWritten;
                byteOffset += bytesWritten;
            }
        } catch (ErrnoException errnoException) {
            throw errnoException.rethrowAsIOException();
        }
    }
581453
def push_byte(self, stack_pointer, byte):
        
        # FIXME: self.system_stack_pointer -= 1
        stack_pointer.decrement(1)
        addr = stack_pointer.value

#        log.info(
#         log.error(
#            "%x|\tpush $%x to %s stack at $%x\t|%s",
#            self.last_op_address, byte, stack_pointer.name, addr,
#            self.cfg.mem_info.get_shortest(self.last_op_address)
#        )
        self.memory.write_byte(addr, byte)
617494
public void write(io.netty.buffer.ByteBuf buf, int off, int len) throws IOException {
    if (len == 0) {
      return;
    }

    while (len > 0) {
      updateCurrentChunk(false);
      int toWrite = Math.min(len, mCurrentChunk.writableBytes());
      mCurrentChunk.writeBytes(buf, off, toWrite);
      off += toWrite;
      len -= toWrite;
    }
    updateCurrentChunk(false);
  }
1230231
def copy_in_bytes bytes, len
      data_buffer = LibC.malloc len
      # writes the exact number of bytes, no null byte to terminate string
      data_buffer.write_string bytes, len

      # use libC to call free on the data buffer; earlier versions used an
      # FFI::Function here that called back into Ruby, but Rubinius won't 
      # support that and there are issues with the other runtimes too
      LibXS.xs_msg_init_data @pointer, data_buffer, len, LibC::Free, nil
    end
256972
def add(self, data):
        """"""
        assert isinstance(data, bytes)
        with self.lock:
            self.buf += data
296949
def write(self, byte):
        
        if self.is_closed_flag:
            raise Exception("Unable to write - already closed!")
        self.written += len(byte)
        self.file.write(byte)
76935
public void write(final byte[] srcBytes, final int srcOffset, final int length)
    {
        buffer.putBytes(offset + position, srcBytes, srcOffset, length);
        position += length;
    }
831603
public void writeBytes(final byte[] bytes, final int off, final int len)
    {
        if (len > remaining())
        {
            writeBytesSlow(bytes, off, len);
            return;
        }

        final Block block = current;
        System.arraycopy(bytes, off, block.data, block.limit, len);
        block.limit += len;
    }
1197604
def write_file(file, b):
	
	if hasattr(file, "write_bytes"):
		file.write_bytes(b)
	elif hasattr(file, "write"):
		file.write(b)
	else:
		with open(file, "wb") as f:
			f.write(b)
502574
async def _write(self, path, data, *,
                     flags=None, cas=None, acquire=None, release=None):
        
        if not isinstance(data, bytes):
            raise ValueError("value must be bytes")
        path = "/v1/kv/%s" % path
        response = await self._api.put(
            path,
            params={
                "flags": flags,
                "cas": cas,
                "acquire": acquire,
                "release": release
            },
            data=data,
            headers={"Content-Type": "application/octet-stream"})
        return response
125753
static void writeBytesToFile(File file, byte[] bytes) throws IOException {
        BufferedOutputStream bos = null;

        try {
            FileOutputStream fos = new FileOutputStream(file);
            bos = new BufferedOutputStream(fos);
            bos.write(bytes);
        } finally {
            if (bos != null) {
                try  {
                    // flush and close the BufferedOutputStream
                    bos.flush();
                    bos.close();
                } catch (Exception e) {}
            }
        }
    }
1291589
def write(dump)
      with_flock(File::LOCK_EX) do
        @fd.write(dump)
        # Flush to make sure the file is really updated
        @fd.flush
      end
      @pos = @fd.pos if @pos && @fd.pos == @pos + dump.bytesize
    end