title: How to send byte array using twisted python
body: <p>Here, in sendQuote method I want to send a byte array but twisted provides transport write method which takes string. How can i send a byte array in response using Twisted. Thanks. </p>
  
  <pre><code>class QuoteProtocol(protocol.Protocol):
    def __init__(self, factory):
      self.factory = factory
  
    def connectionMade(self):
      self.sendQuote()
  
    def sendQuote(self):
      #self.file.write(bytearray([0x00, 0x31, 0x34, 0x32, 0x30, 0x30, 0x30, 0x30, 0x31, 0x11, 0x0c, 0x00, 0xfd, 0x09, 0x00, 0x2f, 0xe7, 0x5e, 0x3a, 0x08, 0x3c, 0x00, 0x00, 0x00, 0x49, 0x95]))
      self.transport.write("Quote reecevied")
  
    def dataReceived(self, data):
      print "Received quote:", data
      self.transport.loseConnection()
  </code></pre>