AgGateway.ADAPT.ISOv4Plugin.ExportMappers.BinaryWriter.WritePosition C# (CSharp) Method

WritePosition() private method

private WritePosition ( AgGateway.ADAPT.ApplicationDataModel.Shapes.Shape geometry, MemoryStream memoryStream ) : void
geometry AgGateway.ADAPT.ApplicationDataModel.Shapes.Shape
memoryStream System.IO.MemoryStream
return void
        private void WritePosition(Shape geometry, MemoryStream memoryStream)
        {
            if (geometry == null)
                return;

            var location = geometry as Point;

            if (location == null) return;

            var north = (Int32) (location.Y/CoordinateMultiplier);
            var east = (Int32) (location.X/CoordinateMultiplier);
            var up = (Int32) (location.Z.GetValueOrDefault());

            var northStream = new MemoryStream(BitConverter.GetBytes(north));
            northStream.WriteTo(memoryStream);

            var eastStream = new MemoryStream(BitConverter.GetBytes(east));
            eastStream.WriteTo(memoryStream);

            var upStream = new MemoryStream(BitConverter.GetBytes(up));
            upStream.WriteTo(memoryStream);
        }