docs: def write (self, bytes, header=None):
          """write() is meant to work like the normal file write().  It takes
          two arguments, a byte array to write to the file as a single
          PCAP packet, and an optional header if one already exists.
          The length of the byte array should be less than 65535 bytes.
          write() returns the number of bytes actually written to the file.
          """
          if type(bytes) is str:
              bytes = bytearray(bytes)
  
          if not isinstance(header, PCapPacketHeader):
              header = PCapPacketHeader(orig_len=len(bytes))
  
          packet = bytes[0:header.incl_len]
  
          self._stream.write( str(header) )
          self._stream.write( packet      )
          self._stream.flush()
  
          return header.incl_len