@staticmethod
  def ReadHeader(stream):
    # Python 2.7.3 needs a string to unpack, so cast to one.
    header, = unpack('!i', str(stream.read(4)))
    msg_type = (256 - (header >> 24 & 0xff)) * -1
    tag = ((header << 8) & 0xFFFFFFFF) >> 8
    return msg_type, tag
Read a mux header off a message.
dataset/ETHPy150Open steveniemitz/scales/scales/thriftmux/sink.py/ThriftMuxMessageSerializerSink.ReadHeader