Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Issue 9653026: Add writeString method to OutputStream (Closed)

Created:
8 years, 9 months ago by Søren Gjesse
Modified:
8 years, 9 months ago
Reviewers:
Mads Ager (google)
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add writeString method to OutputStream All output streams now supports writeString which takes the encoding to be used when transforming the string into a sequence of bytes. This change also introduces an Encoding interface and Encodings class as a repository for the supported encodings. Currently this is only UTF-8, ISO-8859-1 and ASCII. All methods in dart:io which previously used a String to represent the encoding now uses objects implementing Encoding. In this change dart:io is still using the internal UTF-8 encoder used by the HTTP implementation. I will look into using the one in dart:utf in a separate change. R=ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=5231

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed review comments from ager@ #

Patch Set 3 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+319 lines, -210 lines) Patch
M runtime/bin/file.dart View 1 2 chunks +21 lines, -20 lines 0 comments Download
M runtime/bin/file_impl.dart View 1 7 chunks +11 lines, -22 lines 0 comments Download
M runtime/bin/http.dart View 1 2 2 chunks +0 lines, -16 lines 0 comments Download
M runtime/bin/http_impl.dart View 1 2 5 chunks +1 line, -70 lines 0 comments Download
M runtime/bin/input_stream.dart View 1 3 chunks +16 lines, -3 lines 0 comments Download
M runtime/bin/list_stream_impl.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/output_stream.dart View 1 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/bin/socket_stream_impl.dart View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/bin/stream_util.dart View 1 1 chunk +12 lines, -0 lines 0 comments Download
M runtime/bin/string_stream.dart View 1 5 chunks +158 lines, -43 lines 0 comments Download
M samples/chat/chat_server_lib.dart View 1 chunk +1 line, -1 line 0 comments Download
M samples/chat/chat_stress_client.dart View 4 chunks +8 lines, -6 lines 0 comments Download
M samples/tests/samples/src/chat/ChatServerTest.dart View 4 chunks +4 lines, -4 lines 0 comments Download
M tests/standalone/src/io/FileTest.dart View 1 6 chunks +34 lines, -9 lines 0 comments Download
M tests/standalone/src/io/HttpShutdownTest.dart View 4 chunks +4 lines, -4 lines 0 comments Download
M tests/standalone/src/io/HttpTest.dart View 5 chunks +8 lines, -8 lines 0 comments Download
M tests/standalone/src/io/ListOutputStreamTest.dart View 1 1 chunk +25 lines, -0 lines 0 comments Download
M tests/standalone/src/io/StringStreamTest.dart View 1 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Søren Gjesse
8 years, 9 months ago (2012-03-09 10:35:04 UTC) #1
Mads Ager (google)
https://chromiumcodereview.appspot.com/9653026/diff/1/runtime/bin/file.dart File runtime/bin/file.dart (right): https://chromiumcodereview.appspot.com/9653026/diff/1/runtime/bin/file.dart#newcode9 runtime/bin/file.dart:9: class FileMode { Maybe we can use this style ...
8 years, 9 months ago (2012-03-09 11:22:50 UTC) #2
Mads Ager (google)
Oh and LGTM!
8 years, 9 months ago (2012-03-09 11:22:59 UTC) #3
Søren Gjesse
8 years, 9 months ago (2012-03-09 13:49:25 UTC) #4
http://codereview.chromium.org/9653026/diff/1/runtime/bin/file.dart
File runtime/bin/file.dart (right):

http://codereview.chromium.org/9653026/diff/1/runtime/bin/file.dart#newcode9
runtime/bin/file.dart:9: class FileMode {
On 2012/03/09 11:22:50, Mads Ager wrote:
> Maybe we can use this style for Encoding as well? I think we should make them
> consistent.

Done.

http://codereview.chromium.org/9653026/diff/1/runtime/bin/file.dart#newcode279
runtime/bin/file.dart:279: * string cannot be written the [onError] is called.
The default
On 2012/03/09 11:22:50, Mads Ager wrote:
> This is my fault, could you fix it? ;-)
> 
> the [onError] function is called
> 
> or
> 
> [onError] is called

Done.

Powered by Google App Engine
This is Rietveld 408576698