Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ByteArrayConverter.cs
Go to the documentation of this file.
2
3internal sealed class ByteArrayConverter : JsonConverter<byte[]>
4{
6 {
7 if (reader.TokenType == JsonTokenType.Null)
8 {
9 return null;
10 }
11 return reader.GetBytesFromBase64();
12 }
13
15 {
16 if (value == null)
17 {
18 writer.WriteNullValue();
19 }
20 else
21 {
22 writer.WriteBase64StringValue(value);
23 }
24 }
25}
override void Write(Utf8JsonWriter writer, byte[] value, JsonSerializerOptions options)
override byte[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)