Skip to content

Commit

Permalink
Add CreateAsynchronousJsonWriter to IStreamBasedJsonWriterFactoryAsyn…
Browse files Browse the repository at this point in the history
…c interface (#2461)
  • Loading branch information
habbes authored Jul 19, 2022
1 parent 45430f6 commit a12e596
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public IJsonWriter CreateJsonWriter(Stream stream, bool isIeee754Compatible, Enc

return new ODataUtf8JsonWriter(stream, isIeee754Compatible, encoding, encoder: this.encoder);
}

public IJsonWriterAsync CreateAsynchronousJsonWriter(Stream stream, bool isIeee754Compatible, Encoding encoding)
{
throw new NotImplementedException();
}
}
}
#endif
11 changes: 11 additions & 0 deletions src/Microsoft.OData.Core/Json/IStreamBasedJsonWriterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,16 @@ public interface IStreamBasedJsonWriterFactory
/// <param name="encoding">The text encoding of the output data.</param>
/// <returns>The JSON writer created.</returns>
IJsonWriter CreateJsonWriter(Stream stream, bool isIeee754Compatible, Encoding encoding);

/// <summary>
/// Creates an asynchronous JSON writer of <see cref="IJsonWriterAsync"/>.
/// The returned instance should also implement the synchronous <see cref="IJsonWriter"/>
/// interface.
/// </summary>
/// <param name="stream">Output stream to which the resulting <see cref="IJsonWriterAsync"/> should write data.</param>
/// <param name="isIeee754Compatible">True if it is IEEE754Compatible.</param>
/// <param name="encoding">The text encoding of the output data.</param>
/// <returns>The JSON writer created.</returns>
IJsonWriterAsync CreateAsynchronousJsonWriter(Stream stream, bool isIeee754Compatible, Encoding encoding);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public IJsonWriter CreateJsonWriter(Stream stream, bool isIeee754Compatible, Enc
{
return this.jsonWriter;
}

public IJsonWriterAsync CreateAsynchronousJsonWriter(Stream stream, bool isIeee754Compatible, Encoding encoding)
{
throw new System.NotImplementedException();
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public IJsonWriter CreateJsonWriter(Stream stream, bool isIeee754Compatible, Enc
return writer;
}

public IJsonWriterAsync CreateAsynchronousJsonWriter(Stream stream, bool isIeee754Compatible, Encoding encoding)
{
throw new NotImplementedException();
}

/// <summary>
/// The <see cref="IJsonWriter"/> that was last created by the wrapped <see cref="IStreamBasedJsonWriterFactory"/>.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5975,6 +5975,7 @@ public interface Microsoft.OData.Json.IJsonWriterFactoryAsync {
CLSCompliantAttribute(),
]
public interface Microsoft.OData.Json.IStreamBasedJsonWriterFactory {
Microsoft.OData.Json.IJsonWriterAsync CreateAsynchronousJsonWriter (System.IO.Stream stream, bool isIeee754Compatible, System.Text.Encoding encoding)
Microsoft.OData.Json.IJsonWriter CreateJsonWriter (System.IO.Stream stream, bool isIeee754Compatible, System.Text.Encoding encoding)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5975,6 +5975,7 @@ public interface Microsoft.OData.Json.IJsonWriterFactoryAsync {
CLSCompliantAttribute(),
]
public interface Microsoft.OData.Json.IStreamBasedJsonWriterFactory {
Microsoft.OData.Json.IJsonWriterAsync CreateAsynchronousJsonWriter (System.IO.Stream stream, bool isIeee754Compatible, System.Text.Encoding encoding)
Microsoft.OData.Json.IJsonWriter CreateJsonWriter (System.IO.Stream stream, bool isIeee754Compatible, System.Text.Encoding encoding)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5975,6 +5975,7 @@ public interface Microsoft.OData.Json.IJsonWriterFactoryAsync {
CLSCompliantAttribute(),
]
public interface Microsoft.OData.Json.IStreamBasedJsonWriterFactory {
Microsoft.OData.Json.IJsonWriterAsync CreateAsynchronousJsonWriter (System.IO.Stream stream, bool isIeee754Compatible, System.Text.Encoding encoding)
Microsoft.OData.Json.IJsonWriter CreateJsonWriter (System.IO.Stream stream, bool isIeee754Compatible, System.Text.Encoding encoding)
}

Expand Down

0 comments on commit a12e596

Please sign in to comment.