code: def write_ushort(self, s):
          
          if type(s) not in python.int_types:
              raise TypeError('expected an int (got:%r)' % (type(s),))
  
          if not 0 <= s <= 65535:
              raise OverflowError("Not in range, %d" % s)
  
          self.write(struct.pack("%sH" % self.endian, s))
docs: Writes a 2 byte unsigned integer to the stream.
  
          @param s: 2 byte unsigned integer
          @type s: C{int}
          @raise TypeError: Unexpected type for int C{s}.
          @raise OverflowError: Not in range.