@@ -38,13 +38,14 @@ The library provides abstract base classes to build your own encoder and decoder
3838``` csharp
3939using PolylineAlgorithm ;
4040using PolylineAlgorithm .Abstraction ;
41+ using PolylineAlgorithm .Internal ;
4142
4243public sealed class MyPolylineEncoder : AbstractPolylineEncoder <(double Latitude , double Longitude ), string > {
43- protected override void Write ((double Latitude , double Longitude ) item , IPolylineWriter writer ) {
44+ protected override void Write ((double Latitude , double Longitude ) item , ref PolylineWriter writer ) {
4445 writer .Write (item .Latitude ); // field 0
4546 writer .Write (item .Longitude ); // field 1
4647 }
47- protected override string CreatePolyline (ReadOnlyMemory <char > polyline ) => polyline .ToString ();
48+ protected override string CreatePolyline (ReadOnlySpan <char > polyline ) => polyline .ToString ();
4849}
4950```
5051
@@ -71,9 +72,10 @@ Console.WriteLine(encoded);
7172``` csharp
7273using PolylineAlgorithm ;
7374using PolylineAlgorithm .Abstraction ;
75+ using PolylineAlgorithm .Internal ;
7476
7577public sealed class MyPolylineDecoder : AbstractPolylineDecoder <string , (double Latitude , double Longitude )> {
76- protected override (double Latitude , double Longitude ) Read (IPolylineReader reader ) =>
78+ protected override (double Latitude , double Longitude ) Read (PolylineReader reader ) =>
7779 (reader .Read (), reader .Read ()); // field 0, field 1
7880 protected override ReadOnlyMemory <char > GetReadOnlyMemory (in string polyline ) => polyline .AsMemory ();
7981}
0 commit comments