@@ -25,14 +25,14 @@ We then use the methods of the <code>FileReader</code> interface to read the <co
2525@code {
2626 string log = " " ;
2727 private string imageUrl = " " ;
28- private Blob blob ;
28+ private Blob ? blob ;
2929
3030 protected override async Task OnInitializedAsync ()
3131 {
3232 var imageBytes = await HttpClient .GetByteArrayAsync ($" images/mountain.jpg" );
3333 blob = await Blob .CreateAsync (
3434 JSRuntime ,
35- blobParts : new BlobPart [] { new ( imageBytes ) },
35+ blobParts : new BlobPart [] { imageBytes },
3636 options : new () { Type = " image/png" }
3737 );
3838 }
@@ -66,7 +66,7 @@ We then use the methods of the <code>FileReader</code> interface to read the <co
6666 imageUrl = " data:image/png;base64," + Convert .ToBase64String (await fileReader .GetResultAsByteArrayAsync () ?? new byte [0 ]);
6767 await GetProgressAsync (e , " OnLoadEnd" );
6868 };
69- await fileReader .ReadAsArrayBufferAsync (blob );
69+ await fileReader .ReadAsArrayBufferAsync (blob ! );
7070 }
7171
7272 public async Task ReadAsArrayBufferInProcessAsync ()
@@ -83,7 +83,7 @@ We then use the methods of the <code>FileReader</code> interface to read the <co
8383 imageUrl = " data:image/png;base64," + Convert .ToBase64String (fileReader .ResultAsByteArray ?? new byte [0 ]);
8484 GetProgress (e , " OnLoadEnd" );
8585 };
86- fileReader .ReadAsArrayBuffer (blob );
86+ fileReader .ReadAsArrayBuffer (blob ! );
8787 }
8888
8989 public async Task ReadAsBinaryStringAsync ()
@@ -101,7 +101,7 @@ We then use the methods of the <code>FileReader</code> interface to read the <co
101101 imageUrl = " data:image/png;base64," + Convert .ToBase64String (bytes );
102102 await GetProgressAsync (e , " OnLoadEnd" );
103103 };
104- await fileReader .ReadAsBinaryStringAsync (blob );
104+ await fileReader .ReadAsBinaryStringAsync (blob ! );
105105 }
106106
107107 public void ReadAsText ()
@@ -125,6 +125,6 @@ We then use the methods of the <code>FileReader</code> interface to read the <co
125125 imageUrl = await fileReader .GetResultAsStringAsync () ?? " " ;
126126 await GetProgressAsync (e , " OnLoadEnd" );
127127 };
128- await fileReader .ReadAsDataURLAsync (blob );
128+ await fileReader .ReadAsDataURLAsync (blob ! );
129129 }
130130}
0 commit comments