Put bytes string in object at addr and append terminating zero at end.
353203
def putsz(self, addr, s):
        """"""
        self.puts(addr, s)
        self._buf[addr+len(s)] = 0
819226
public void append(char c[], int off, int len) {
	int restLength = buffer.length - pos;
	if (len < restLength) {
	    System.arraycopy(c, off, buffer, pos, len);
	    pos += len;
	}
	else {
	    System.arraycopy(c, off, buffer, pos, restLength);
	    curr.next = new Entity(buffer);
	    curr = curr.next;
	    length += buffer.length;
	    buffer = new char[(buffer.length > len - restLength) ? buffer.length : len - restLength];

	    System.arraycopy(c, off + restLength, buffer, 0, len - restLength);
	    pos = len - restLength;

	}
    }
1031604
def set_data(self, data):
		""
		if data is None:
			self.data_size = 0
			self.data = None
			return
		self.data_size = len(data)
		# create a string buffer so that null bytes aren't interpreted
		#  as the end of the string
		self.data = ctypes.cast(ctypes.create_string_buffer(data), ctypes.c_void_p)
381484
def bytes(self):
        """"""
        addrbyte = b'\x00\x00\x00'
        if self.addr is not None:
            addrbyte = self.addr
        return addrbyte
1015981
public static void append(StringBuilder buf, byte b, int base) {
        int bi = 0xff & b;
        int c = '0' + (bi / base) % base;
        if (c > '9')
            c = 'a' + (c - '0' - 10);
        buf.append((char) c);
        c = '0' + bi % base;
        if (c > '9')
            c = 'a' + (c - '0' - 10);
        buf.append((char) c);
    }
159604
def end_byte(self):
        """"""
        return min(
            (self.part_number + 1) * self.multipart.chunk_size,
            self.multipart.size
        )
333100
private void writeByte(int b)
    {
        int offset = myOffset;
        if (--offset < 0) {
            offset = growBuffer(offset);
        }
        // Using narrowing primitive conversion from int to byte
        myBuffer[offset] = (byte) b;
        myOffset = offset;
    }
241563
private int writeShort(String value, int offset, int end)
    throws IOException
  {
    int ch;
  
    OutputStreamWithBuffer os = _os;
    byte []buffer = os.buffer();
    int bOffset = os.offset();
    
    end = Math.min(end, offset + buffer.length - bOffset);
  
    for (; offset < end && (ch = value.charAt(offset)) < 0x80; offset++) {
      buffer[bOffset++] = (byte) ch;
    }
    
    os.offset(bOffset);
    
    return offset;
  }
1238109
public void putByte(int pos, byte b) {
		adaptSize(pos + 1);
		ByteBuffer bb = getBuffer(pos);
		int i = pos % _bufferSize;
		bb.put(i, b);
	}
347446
public int strLength(byte[]bytes, int p, int end) {
        int n = 0;
        int q = p;
        while (q < end) {
            q += length(bytes, q, end);
            n++;
        }
        return n;
    }
1034141
def add_0x(string):
    
    if isinstance(string, bytes):
        string = string.decode('utf-8')
    return '0x' + str(string)
1024208
def append_var_uint32(self, value):
        
        if not 0 <= value <= wire_format.UINT32_MAX:
            raise errors.EncodeError('Value out of range: %d' % value)
        self.append_var_uint64(value)
936797
def _buf_append(self, string):
        ''''''
        if not self._buf:
            self._buf = string
        else:
            self._buf += string
256972
def add(self, data):
        """"""
        assert isinstance(data, bytes)
        with self.lock:
            self.buf += data
1282777
public void putBytes(byte[] b, int boff, int len) {
        System.arraycopy(b, boff, _buffer, _offset, len);
        skip(len);
    }
96742
def write_bytes(self, bytes, append=False):
        
        if append:
            mode = 'ab'
        else:
            mode = 'wb'
        with self.open(mode) as f:
            f.write(bytes)
1118747
def _append_bytes(self, value, _file):  # pylint: disable=no-self-use
        
        # binascii.b2a_base64(value) -> plistlib.Data
        # binascii.a2b_base64(Data) -> value(bytes)

        _text = ' '.join(textwrap.wrap(value.hex(), 2))
        # _data = [H for H in iter(
        #         functools.partial(io.StringIO(value.hex()).read, 2), '')
        #         ]  # to split bytes string into length-2 hex string list
        _labs = ' "{text}"'.format(text=_text)
        _file.write(_labs)