Make IOSink implement StringSink

Besides adding the StringSink methods I also added writeBytes and
deprecated both add and addString.

To handle the encoding of strings the IOSike has an encoding
property. This property is mutable in situation when it makes sense to
change encoding of what is written. The exception here is for HTTP
where the encoding is determined from the header and the encoding
cannot be changed.

R=ajohnsen@google.com, ager@google.com, nweiz@google.com

BUG=

Review URL: https://codereview.chromium.org//12504006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/http@19676 260f80e4-7a28-3924-810f-c04153c831b5
2 files changed
tree: 043f6bc1993fc9a146cdf6a7e2268b82f26caa9f
  1. lib/
  2. test/
  3. pubspec.yaml