blob: e34112df29dfb6cbba4ed4fda5705faae599944a [file] [log] [blame]
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:typed_data';
import 'package:protobuf/protobuf.dart';
List<int> protoToDelimitedBuffer(GeneratedMessage message) {
var messageBuffer = new CodedBufferWriter();
var delimiterBuffer = new CodedBufferWriter();
var result = new Uint8List(
messageBuffer.lengthInBytes + delimiterBuffer.lengthInBytes);
messageBuffer.writeTo(result, delimiterBuffer.lengthInBytes);
return result;