Ejemplo n.º 1
0
        private static byte[] SerializeGraphExtraInfo(NavGraph graph)
        {
            MemoryStream memoryStream     = new MemoryStream();
            BinaryWriter binaryWriter     = new BinaryWriter(memoryStream);
            GraphSerializationContext ctx = new GraphSerializationContext(binaryWriter);

            graph.SerializeExtraInfo(ctx);
            byte[] result = memoryStream.ToArray();
            binaryWriter.Close();
            return(result);
        }
Ejemplo n.º 2
0
        /** Serializes info returned by NavGraph.SerializeExtraInfo */
        static byte[] SerializeGraphExtraInfo(NavGraph graph)
        {
            var stream = new MemoryStream();
            var wr     = new BinaryWriter(stream);
            var ctx    = new GraphSerializationContext(wr);

            graph.SerializeExtraInfo(ctx);
            byte[] bytes = stream.ToArray();
            CloseOrDispose(wr);

            return(bytes);
        }
Ejemplo n.º 3
0
        /** Serializes info returned by NavGraph.SerializeExtraInfo */
        static byte[] SerializeGraphExtraInfo(NavGraph graph)
        {
            var stream = new MemoryStream();
            var wr     = new BinaryWriter(stream);
            var ctx    = new GraphSerializationContext(wr);

            graph.SerializeExtraInfo(ctx);
            byte[] bytes = stream.ToArray();

#if NETFX_CORE
            wr.Dispose();
#else
            wr.Close();
#endif

            return(bytes);
        }