Table of Contents

Class FileReaderSync

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The FileReaderSync interface allows to read File or Blob objects synchronously. This interface is only available in workers as it enables synchronous I/O that could potentially block.

[Value("FileReaderSync")]
public class FileReaderSync
Inheritance
FileReaderSync
Inherited Members

Remarks

Constructors

FileReaderSync()

The FileReaderSync() constructor creates a new FileReaderSync.

public FileReaderSync()

Remarks

Methods

ReadAsArrayBuffer(Blob)

The readAsArrayBuffer() method of the FileReaderSync interface allows to read File or Blob objects in a synchronous way into an {{jsxref("ArrayBuffer")}}. This interface is only available in workers as it enables synchronous I/O that could potentially block.

[Value("readAsArrayBuffer")]
public ArrayBuffer ReadAsArrayBuffer(Blob blob)

Parameters

blob Blob

Returns

ArrayBuffer

An ArrayBuffer representing the file's data.

Remarks

-{{DOMxRef("File API", "", "", "nocode")}}
-File
-FileReaderSync
-FileReader
-Blob

See also on MDN

ReadAsBinaryString(Blob)

IMPORTANT
Deprecated
NOTE
This method is deprecated in favor of ReadAsArrayBuffer(Blob).
[Value("readAsBinaryString")]
public string ReadAsBinaryString(Blob blob)

Parameters

blob Blob

Returns

string

A string representing the input data.

Remarks

The readAsBinaryString() method of the FileReaderSync interface allows to read File or Blob objects in a synchronous way into a string. This interface is only available in workers as it enables synchronous I/O that could potentially block.

-File API
-File
-FileReaderSync
-FileReader
-Blob

See also on MDN

ReadAsDataURL(Blob)

The readAsDataURL() method of the FileReaderSync interface allows to read File or Blob objects in a synchronous way into a string representing a data URL. This interface is only available in workers as it enables synchronous I/O that could potentially block.

[Value("readAsDataURL")]
public string ReadAsDataURL(Blob blob)

Parameters

blob Blob

Returns

string

A string representing the input data as a data URL.

Remarks

ReadAsText(Blob, string)

The readAsText() method of the FileReaderSync interface allows to read File or Blob objects in a synchronous way into a string. This interface is only available in workers as it enables synchronous I/O that could potentially block.

[Value("readAsText")]
public string ReadAsText(Blob blob, string encoding = null)

Parameters

blob Blob
encoding string

Returns

string

A string representing the input data.

Remarks