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

Unified Diff: runtime/bin/file_impl.dart

Issue 10379018: Revert "Revert "Implement {Int,Uint}{8,16,32,64} and Float{32,64} typed arrays."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/bin/file_impl.dart
diff --git a/runtime/bin/file_impl.dart b/runtime/bin/file_impl.dart
index 40dbe5a106597ace0cf54e6fddfec67c3397a595..fc966cf941b9c4ccf82c78e667093e2792daf50c 100644
--- a/runtime/bin/file_impl.dart
+++ b/runtime/bin/file_impl.dart
@@ -24,7 +24,7 @@ class _FileInputStream extends _BaseDataInputStream implements InputStream {
void _readDataFromFile(RandomAccessFile openedFile) {
openedFile.onError = _reportError;
openedFile.length((length) {
- var contents = new ByteArray(length);
+ var contents = new Uint8List(length);
if (length != 0) {
openedFile.readList(contents, 0, length, (read) {
if (read != length) {
@@ -56,7 +56,7 @@ class _FileInputStream extends _BaseDataInputStream implements InputStream {
}
List<int> _read(int bytesToRead) {
- ByteArray result = new ByteArray(bytesToRead);
+ List<int> result = new Uint8List(bytesToRead);
result.setRange(0, bytesToRead, _data, _position);
_position += bytesToRead;
_checkScheduleCallbacks();
@@ -113,7 +113,7 @@ class _FileOutputStream extends _BaseOutputStream implements OutputStream {
var data = buffer;
if (copyBuffer) {
var length = buffer.length;
- data = new ByteArray(length);
+ data = new Uint8List(length);
data.setRange(0, length, buffer, 0);
}
if (_file == null) {
@@ -131,7 +131,7 @@ class _FileOutputStream extends _BaseOutputStream implements OutputStream {
if (len > length) throw new IndexOutOfRangeException(len);
length = len;
}
- var copy = new ByteArray(length);
+ var copy = new Uint8List(length);
copy.setRange(0, length, buffer, offset);
return write(copy);
}
@@ -222,10 +222,10 @@ class _FileUtils {
// supplied List to a ByteArray if it isn't already.
List outBuffer;
int outOffset = offset;
- if (buffer is ByteArray || buffer is ObjectArray) {
+ if (buffer is Uint8List || buffer is ObjectArray) {
outBuffer = buffer;
} else {
- outBuffer = new ByteArray(bytes);
+ outBuffer = new Uint8List(bytes);
outOffset = 0;
int j = offset;
for (int i = 0; i < bytes; i++) {
@@ -601,7 +601,7 @@ class _File extends _FileBase implements File {
List<int> readAsBytesSync() {
var opened = openSync();
var length = opened.lengthSync();
- var result = new ByteArray(length);
+ var result = new Uint8List(length);
var read = opened.readListSync(result, 0, length);
if (read != length) {
throw new FileIOException("Failed to read file");
« no previous file with comments | « runtime/bin/file.cc ('k') | runtime/bin/http_impl.dart » ('j') | runtime/include/dart_api.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698