Changeset 15509 for branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/ProtoBufSerializer.cs
- Timestamp:
- 12/11/17 17:46:11 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/ProtoBufSerializer.cs
r13367 r15509 21 21 22 22 using System.IO; 23 using Google.Protobuf; 23 24 24 25 namespace HeuristicLab.Persistence { 25 26 public sealed class ProtoBufSerializer : Serializer { 26 27 protected override void SerializeBundle(Bundle bundle, Stream stream) { 27 bundle.WriteTo(stream); 28 using (var outputStream = new CodedOutputStream(stream)) 29 bundle.WriteTo(outputStream); 28 30 } 29 31 30 32 protected override Bundle DeserializeBundle(Stream stream) { 31 return Bundle.ParseFrom(stream, Mapper.StaticCache.GetExtensionRegistry()); 33 using (var inputStream = new CodedInputStream(stream)) 34 return Bundle.Parser.ParseFrom(inputStream); 32 35 } 33 36 }
Note: See TracChangeset
for help on using the changeset viewer.