Change http code in pkg to use dart:typeddata instead of dart:scalarlist

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20642 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
asiva@google.com 2013-03-28 20:51:43 +00:00
parent c590e8ae0c
commit 5e3c5d5568
7 changed files with 8 additions and 9 deletions

View file

@ -54,7 +54,7 @@
library http;
import 'dart:async';
import 'dart:scalarlist';
import 'dart:typeddata';
import 'dart:uri';
import 'src/client.dart';

View file

@ -6,7 +6,7 @@ library base_client;
import 'dart:async';
import 'dart:io';
import 'dart:scalarlist';
import 'dart:typeddata';
import 'dart:uri';
import 'base_request.dart';

View file

@ -6,7 +6,7 @@ library byte_stream;
import 'dart:async';
import 'dart:io';
import 'dart:scalarlist';
import 'dart:typeddata';
import 'utils.dart';

View file

@ -6,7 +6,7 @@ library client;
import 'dart:async';
import 'dart:io';
import 'dart:scalarlist';
import 'dart:typeddata';
import 'base_client.dart';
import 'base_request.dart';

View file

@ -6,7 +6,7 @@ library request;
import 'dart:async';
import 'dart:io';
import 'dart:scalarlist';
import 'dart:typeddata';
import 'dart:uri';
import 'base_request.dart';

View file

@ -6,7 +6,7 @@ library response;
import 'dart:async';
import 'dart:io';
import 'dart:scalarlist';
import 'dart:typeddata';
import 'base_request.dart';
import 'base_response.dart';

View file

@ -7,7 +7,7 @@ library utils;
import 'dart:async';
import 'dart:crypto';
import 'dart:io';
import 'dart:scalarlist';
import 'dart:typeddata';
import 'dart:uri';
import 'dart:utf';
@ -116,8 +116,7 @@ bool isPlainAscii(String string) => _ASCII_ONLY.hasMatch(string);
/// [ByteArrayViewable], this just returns a view on [input].
Uint8List toUint8List(List<int> input) {
if (input is Uint8List) return input;
if (input is ByteArrayViewable) input = input.asByteArray();
if (input is ByteArray) return new Uint8List.view(input);
if (input is ByteData) return new Uint8List.view(input.buffer);
var output = new Uint8List(input.length);
output.setRange(0, input.length, input);
return output;