OLD | NEW |
1 // Copyright (c) 2014, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library capnp.serialize; | 5 library capnp.serialize; |
6 | 6 |
7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
8 import 'dart:math' show max; | 8 import 'dart:math' show max; |
9 import 'dart:io' show BytesBuilder; | 9 import 'dart:io' show BytesBuilder; |
10 | 10 |
11 import 'message.dart'; | 11 import 'message.dart'; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 BuilderSegment _newSegment(int words) { | 87 BuilderSegment _newSegment(int words) { |
88 ByteBuffer buffer = new Uint64List(words).buffer; | 88 ByteBuffer buffer = new Uint64List(words).buffer; |
89 int size = words * 8; | 89 int size = words * 8; |
90 ByteData bytes = new ByteData.view(buffer, 0, size); | 90 ByteData bytes = new ByteData.view(buffer, 0, size); |
91 int id = _segments.length; | 91 int id = _segments.length; |
92 BuilderSegment segment = new BuilderSegment(bytes, this, id); | 92 BuilderSegment segment = new BuilderSegment(bytes, this, id); |
93 _segments.add(segment); | 93 _segments.add(segment); |
94 return segment; | 94 return segment; |
95 } | 95 } |
96 } | 96 } |
OLD | NEW |