def write_shortstr(self, s):
self._flushbits()<EOL>if isinstance(s, string):<EOL><INDENT>s = s.encode('<STR_LIT:utf-8>')<EOL><DEDENT>if len(s) > <NUM_LIT:255>:<EOL><INDENT>raise FrameSyntaxError(<EOL>'<STR_LIT>'.format(len(s)))<EOL><DEDENT>self.write_octet(len(s))<EOL>self.out.write(s)<EOL>
Write a string up to 255 bytes long (after any encoding).

        If passed a unicode string, encode with UTF-8.