Home

# Class goog.fs.FileReader

An object for monitoring the reading of files. This emits ProgressEvents of the types listed in {@link goog.fs.FileReader.EventType}.

extends goog.events.EventTarget

Instance Method Summary
| `abort()` Abort the reading of the file.
| `dispatchProgressEvent_(!ProgressEvent event)` Wrap a progress event emitted by the underlying file reader and re-emit it.

`disposeInternal()`

Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:

    MyClass.prototype.disposeInternal = function() {
    MyClass.superClass_.disposeInternal.call(this);
    // Dispose logic for MyClass
    };

| `getError() ⇒ ?goog.fs.Error`
| `getReadyState() ⇒ ?goog.fs.FileReader.ReadyState`
| `getResult() ⇒ <Any Type>`
| `readAsArrayBuffer(!Blob blob)` Starts reading a blob as an array buffer.
| `readAsBinaryString(!Blob blob)` Starts reading a blob as a binary string.
| `readAsDataUrl(!Blob blob)` Starts reading a blob as a data URL.
| `readAsText(!Blob blob, string= opt_encoding)` Starts reading a blob as text.

Static Method Summary
| `createDeferred_(?goog.fs.FileReader reader) ⇒ !goog.async.Deferred` Creates a new deferred object for the results of a read method.
| `readAsArrayBuffer(!Blob blob) ⇒ !goog.async.Deferred` Reads a blob as an array buffer.
| `readAsBinaryString(!Blob blob) ⇒ !goog.async.Deferred` Reads a blob as a binary string.
| `readAsDataUrl(!Blob blob) ⇒ !goog.async.Deferred` Reads a blob as a data URL.
| `readAsText(!Blob blob, string= opt_encoding) ⇒ !goog.async.Deferred` Reads a blob as text.