title: The JSON value could not be converted to System.Byte[]
body: <p>I'm getting the following exception when trying to deserialize the following JSON when dealing with byte arrays, what's wrong?</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Program
  {
      public static void Main()
      {
          var root = JsonSerializer.Deserialize&lt;JsonRoot&gt;(@"{ ""ByteArray"": [1] } ");
      }
  
      public class JsonRoot
      {
          public byte[] ByteArray {get;set;}  
      }
  }
  </code></pre>
  
  <pre><code>Unhandled exception. System.Text.Json.JsonException: The JSON value could not be converted to System.Byte[]. Path: $.ByteArray | LineNumber: 0 | BytePositionInLine: 16.
   ---&gt; System.InvalidOperationException: Cannot get the value of a token type 'StartArray' as a string.
     at System.Text.Json.Utf8JsonReader.TryGetBytesFromBase64(Byte[]&amp; value)
     at System.Text.Json.Utf8JsonReader.GetBytesFromBase64()
     at System.Text.Json.Serialization.Converters.JsonConverterByteArray.Read(Utf8JsonReader&amp; reader, Type typeToConvert, JsonSerializerOptions options)
     at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(ReadStack&amp; state, Utf8JsonReader&amp; reader)
     at System.Text.Json.JsonPropertyInfo.Read(JsonTokenType tokenType, ReadStack&amp; state, Utf8JsonReader&amp; reader)
     at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader&amp; reader, ReadStack&amp; readStack)
     --- End of inner exception stack trace ---
     at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack&amp; readStack, Utf8JsonReader&amp; reader, Exception ex)
     at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader&amp; reader, ReadStack&amp; readStack)
     at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader&amp; reader)
     at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
     at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
     at Program.Main()
  Command terminated by signal 6
  </code></pre>