FileReaderSync

The FileReaderSync interface allows you 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
open external fun readAsArrayBuffer(blob: Blob): ArrayBuffer

The readAsArrayBuffer() method of the FileReaderSync interface allows you 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
open external fun readAsDataURL(blob: Blob): String

The readAsDataURL() method of the FileReaderSync interface allows you 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
open external fun readAsText(blob: Blob, encoding: String = definedExternally): String

The readAsText() method of the FileReaderSync interface allows you 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.