Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CreateAsynchronousJsonWriter to IStreamBasedJsonWriterFactoryAsync #2461

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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();
habbes marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
#endif
11 changes: 11 additions & 0 deletions src/Microsoft.OData.Core/Json/IStreamBasedJsonWriterFactory.cs
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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>
Original file line number Diff line number Diff line change
@@ -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)
}

Original file line number Diff line number Diff line change
@@ -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)
}

Original file line number Diff line number Diff line change
@@ -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)
}