Interface IJsonSerializer
Assembly: MediaBrowser.Model.dll
public interface IJsonSerializer
Methods
Declaration
object DeserializeFromBytes(ReadOnlySpan<byte> bytes, Type type)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Byte> |
bytes |
|
System.Type |
type |
|
Returns
Type |
Description |
System.Object |
|
Declaration
T DeserializeFromBytes<T>(ReadOnlySpan<byte> bytes)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Byte> |
bytes |
|
Returns
Type Parameters
Declaration
T DeserializeFromFile<T>(string file)
where T : class
Parameters
Type |
Name |
Description |
System.String |
file |
The file.
|
Returns
Type Parameters
Exceptions
Type |
Condition |
System.ArgumentNullException |
file
|
Declaration
Task<object> DeserializeFromFileAsync(Type type, string file)
Parameters
Type |
Name |
Description |
System.Type |
type |
The type.
|
System.String |
file |
The file.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Object> |
System.Object.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
type
|
Declaration
Task<T> DeserializeFromFileAsync<T>(string file)
where T : class
Parameters
Type |
Name |
Description |
System.String |
file |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
Declaration
object DeserializeFromSpan(ReadOnlySpan<char> json, Type type)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Char> |
json |
|
System.Type |
type |
|
Returns
Type |
Description |
System.Object |
|
Declaration
T DeserializeFromSpan<T>(ReadOnlySpan<char> text)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Char> |
text |
|
Returns
Type Parameters
Deserializes from stream.
Declaration
object DeserializeFromStream(Stream stream, Type type)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
The stream.
|
System.Type |
type |
The type.
|
Returns
Type |
Description |
System.Object |
System.Object.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
stream
|
Deserializes from stream.
Declaration
T DeserializeFromStream<T>(Stream stream)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
The stream.
|
Returns
Type Parameters
Exceptions
Type |
Condition |
System.ArgumentNullException |
stream
|
Declaration
Task<object> DeserializeFromStreamAsync(Stream stream, Type type)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
|
System.Type |
type |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Object> |
|
Declaration
Task<T> DeserializeFromStreamAsync<T>(Stream stream)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
Deserializes from string.
Declaration
object DeserializeFromString(string json, Type type)
Parameters
Type |
Name |
Description |
System.String |
json |
The json.
|
System.Type |
type |
The type.
|
Returns
Type |
Description |
System.Object |
System.Object.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
json
|
Deserializes from string.
Declaration
T DeserializeFromString<T>(string text)
Parameters
Type |
Name |
Description |
System.String |
text |
The text.
|
Returns
Type Parameters
Exceptions
Type |
Condition |
System.ArgumentNullException |
text
|
Declaration
void DeserializePartialJsonInto(string json, object obj)
Parameters
Type |
Name |
Description |
System.String |
json |
|
System.Object |
obj |
|
Declaration
void SerializeToFile(object obj, string file)
Parameters
Type |
Name |
Description |
System.Object |
obj |
The obj.
|
System.String |
file |
The file.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
obj
|
Declaration
void SerializeToFile(object obj, string file, JsonSerializerOptions options)
Parameters
Type |
Name |
Description |
System.Object |
obj |
The obj.
|
System.String |
file |
The file.
|
JsonSerializerOptions |
options |
The options.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
obj
|
Declaration
ReadOnlySpan<char> SerializeToSpan(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.ReadOnlySpan<System.Char> |
|
Declaration
void SerializeToStream(object obj, Stream stream)
Parameters
Type |
Name |
Description |
System.Object |
obj |
The obj.
|
System.IO.Stream |
stream |
The stream.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
obj
|
Declaration
void SerializeToStream(object obj, Stream stream, JsonSerializerOptions options)
Parameters
Type |
Name |
Description |
System.Object |
obj |
The obj.
|
System.IO.Stream |
stream |
The stream.
|
JsonSerializerOptions |
options |
The options.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
obj
|
Declaration
string SerializeToString(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
The obj.
|
Returns
Type |
Description |
System.String |
System.String.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
obj
|
Declaration
string SerializeToString(object obj, JsonSerializerOptions options)
Parameters
Returns
Type |
Description |
System.String |
System.String.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
obj
|
Extension Methods