FileReaderSync

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.

MDN Reference

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
external fun readAsArrayBuffer(blob: Blob): ArrayBuffer

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

Link copied to clipboard
external fun readAsDataURL(blob: Blob): String

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.

Link copied to clipboard
external fun readAsText(blob: Blob, encoding: String = definedExternally): 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.