def _write_header(name, header, required, stream, encoder, strict=False):
 stream.write_ushort(len(name))
 stream.write_utf8_string(name)
 stream.write_uchar(required)
 write_pos = stream.tell()
 stream.write_ulong(0)
 old_pos = stream.tell()
 encoder.writeElement(header)
 new_pos = stream.tell()
 if strict:
  stream.seek(write_pos)
  stream.write_ulong((new_pos - old_pos))
  stream.seek(new_pos)

def _write_header ( name , header , required , stream , encoder , strict = False ) : stream . write_ushort ( len ( name ) ) stream . write_utf8_string ( name ) stream . write_uchar ( required ) write_pos = stream . tell ( ) stream . write_ulong ( 0 ) old_pos = stream . tell ( ) encoder . writeElement ( header ) new_pos = stream . tell ( ) if strict : stream . seek ( write_pos ) stream . write_ulong ( ( new_pos - old_pos ) ) stream . seek ( new_pos )
write amf message header .