OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of "dart:_vmservice"; | 5 part of "vmservice.dart"; |
6 | 6 |
7 class Asset { | 7 class Asset { |
8 final String name; | 8 final String name; |
9 final Uint8List data; | 9 final Uint8List data; |
10 | 10 |
11 Asset(this.name, this.data); | 11 Asset(this.name, this.data); |
12 | 12 |
13 String get mimeType { | 13 String get mimeType { |
14 var extensionStart = name.lastIndexOf('.'); | 14 var extensionStart = name.lastIndexOf('.'); |
15 var extension = name.substring(extensionStart + 1); | 15 var extension = name.substring(extensionStart + 1); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 int type = _readType(_bs); | 201 int type = _readType(_bs); |
202 _bs.seekToNextBlock(tarHeaderSize); | 202 _bs.seekToNextBlock(tarHeaderSize); |
203 if (type != tarHeaderFileType) { | 203 if (type != tarHeaderFileType) { |
204 _skipContents(_bs, size); | 204 _skipContents(_bs, size); |
205 return null; | 205 return null; |
206 } | 206 } |
207 Uint8List bytes = _readContents(_bs, size); | 207 Uint8List bytes = _readContents(_bs, size); |
208 return new Asset(filename, bytes); | 208 return new Asset(filename, bytes); |
209 } | 209 } |
210 } | 210 } |
OLD | NEW |