@@ -17,41 +17,17 @@ internal JsonSerializerInternal(JsonSerializerOptions options)
1717 public override T Deserialize < T > ( string ? value )
1818 => JsonSerializer . Deserialize < T > ( value , _options ) ;
1919
20+ ValueTask ISerializeAsync . SerializeAsync < T > ( Stream stream , T item , CancellationToken cancellationToken )
21+ => new ValueTask ( JsonSerializer . SerializeAsync ( stream , item , _options , cancellationToken ) ) ;
22+
2023 public new Task SerializeAsync < T > ( Stream stream , T item , CancellationToken cancellationToken = default )
2124 => JsonSerializer . SerializeAsync ( stream , item , _options , cancellationToken ) ;
2225
23- ValueTask ISerializeAsync . SerializeAsync < T > ( Stream stream , T item , CancellationToken cancellationToken )
24- => new ValueTask ( SerializeAsync ( stream , item , cancellationToken ) ) ;
25-
2626 public override string ? Serialize < T > ( T item )
2727 => JsonSerializer . Serialize ( item , _options ) ;
2828
2929 public override ValueTask < T > DeserializeAsync < T > ( Stream stream , CancellationToken cancellationToken = default )
3030 => JsonSerializer . DeserializeAsync < T > ( stream , _options ) ;
31- }
32-
33-
34- internal class JsonSerializerInternal < T > : JsonSerializerBase < T > , IJsonSerializer < T >
35- {
36- readonly JsonSerializerOptions _options ;
37- internal JsonSerializerInternal ( JsonSerializerOptions options )
38- {
39- _options = options ?? throw new ArgumentNullException ( nameof ( options ) ) ;
40- }
41-
42- public override T Deserialize ( string ? value )
43- => JsonSerializer . Deserialize < T > ( value , _options ) ;
44-
45- public new Task SerializeAsync ( Stream stream , T item , CancellationToken cancellationToken = default )
46- => JsonSerializer . SerializeAsync ( stream , item , _options , cancellationToken ) ;
47-
48- ValueTask ISerializeAsync < T > . SerializeAsync ( Stream stream , T item , CancellationToken cancellationToken )
49- => new ValueTask ( SerializeAsync ( stream , item , cancellationToken ) ) ;
50-
51- public override string ? Serialize ( T item )
52- => JsonSerializer . Serialize ( item , _options ) ;
53-
54- public override ValueTask < T > DeserializeAsync ( Stream stream , CancellationToken cancellationToken = default )
55- => JsonSerializer . DeserializeAsync < T > ( stream , _options ) ;
31+
5632 }
5733}
0 commit comments