Skip to content

Commit

Permalink
Virtual serialize methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnii committed Nov 20, 2017
1 parent 572d926 commit dcdea50
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SpeakEasy/Serializers/DefaultJsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ public DefaultJsonSerializer(JsonSerializer serializer, int serializationBufferS
this.serializationBufferSize = serializationBufferSize;
}

public IEnumerable<string> SupportedMediaTypes => new[]
public virtual IEnumerable<string> SupportedMediaTypes => new[]
{
"application/json",
"text/json",
"text/x-json",
"text/javascript"
};

public string MediaType => SupportedMediaTypes.First();
public virtual string MediaType => SupportedMediaTypes.First();

public Task SerializeAsync<T>(Stream stream, T body, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task SerializeAsync<T>(Stream stream, T body, CancellationToken cancellationToken = default(CancellationToken))
{
using (var streamWriter = new StreamWriter(stream, new System.Text.UTF8Encoding(false), serializationBufferSize, true))
{
Expand All @@ -55,7 +55,7 @@ public DefaultJsonSerializer(JsonSerializer serializer, int serializationBufferS
return okTask;
}

public T Deserialize<T>(Stream body)
public virtual T Deserialize<T>(Stream body)
{
using (var streamReader = new StreamReader(body))
{
Expand All @@ -66,7 +66,7 @@ public T Deserialize<T>(Stream body)
}
}

public object Deserialize(Stream body, Type type)
public virtual object Deserialize(Stream body, Type type)
{
using (var streamReader = new StreamReader(body))
{
Expand Down

0 comments on commit dcdea50

Please sign in to comment.