code: def create_frames(self, channel_id, buf, frame_max):
          '''
          A generator which will create frames from a buffer given a max
          frame size.
          '''
          size = frame_max - 8   # 8 bytes overhead for frame header and footer
          offset = 0
          while True:
              payload = buf[offset:(offset + size)]
              if len(payload) == 0:
                  break
              offset += size
  
              yield ContentFrame(channel_id, payload)
              if offset >= len(buf):
                  breaf create_frames(self, channel_id, buf, frame_max):
          '''
          A generator which will create frames from a buffer given a max
          frame size.
          '''
          size = frame_max - 8   # 8 bytes overhead for frame header and footer
          offset = 0
          while True:
              payload = buf[offset:(offset + size)]
              if len(payload) == 0:
                  break
              offset += size
  
              yield ContentFrame(channel_id, payload)
              if offset >= len(buf):
                  break
docs: A generator which will create frames from a buffer given a max
          frame size.