def with_binary(newmode) # :nodoc:
      oldmode = binary
      self.binary = newmode
      begin
        yield
      ensure
        self.binary = oldmode
      end
    end
Toggles transfers in binary mode and yields to a block.
This preserves your current binary send mode, but allows a temporary
transaction with binary sendmode of +newmode+.

+newmode+ is either +true+ or +false+