''

def writeString(self, val):

    assert isinstance(val, (bytes, str, unicode)), ('value    type    not    match!    current    val    type    =    %s' % type(val))
    if isinstance(val, bytes):
        self.stream.write(struct.pack(('=%ss' % (len(val) + 1)), val))
    else:
        val = val.encode('utf-8')
        self.stream.write(struct.pack(('=%ss' % (len(val) + 1)), val))
