public class JsFileReaderSync extends JsElementalMixinBase implements FileReaderSync
SVG_ZOOMANDPAN_DISABLE, SVG_ZOOMANDPAN_MAGNIFY, SVG_ZOOMANDPAN_UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
JsFileReaderSync() |
Modifier and Type | Method and Description |
---|---|
JsArrayBuffer |
readAsArrayBuffer(Blob blob)
|
String |
readAsBinaryString(Blob blob)
|
String |
readAsDataURL(Blob blob)
|
String |
readAsText(Blob blob)
This methods reads the specified blob's contents.
|
String |
readAsText(Blob blob,
String encoding)
This methods reads the specified blob's contents.
|
addEventListener, addEventListener, beginElement, beginElementAt, dispatchEvent, endElement, endElementAt, getAnimatedClassName, getAnimatedHeight, getAnimatedHref, getAnimatedResult, getAnimatedTransform, getAnimatedWidth, getAnimatedX, getAnimatedY, getBBox, getChildElementCount, getCTM, getExternalResourcesRequired, getFarthestViewportElement, getFirstElementChild, getLastElementChild, getNearestViewportElement, getNextElementSibling, getPresentationAttribute, getPreserveAspectRatio, getPreviousElementSibling, getRequiredExtensions, getRequiredFeatures, getScreenCTM, getSvgStyle, getSystemLanguage, getTransformToElement, getViewBox, getXmllang, getXmlspace, getZoomAndPan, hasExtension, querySelector, querySelectorAll, removeEventListener, removeEventListener, setXmllang, setXmlspace, setZoomAndPan
at, at, intAt, intAt, length, numberAt, numberAt, setAt, setAt, setAt, setAt, setAt, setAt
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
intAt, length
numberAt
public final JsArrayBuffer readAsArrayBuffer(Blob blob)
FileReaderSync
This method reads the contents of the specified Blob
or File
. When the read operation is finished, it returns an ArrayBuffer
representing the file's data. If an error happened during the read, the adequate exception is sent.
blob
Blob
or File
to read into the ArrayBuffer
.An ArrayBuffer
representing the file's data.
The following exceptions can be raised by this method:
NotFoundError
Blob
or File
cannot be found, e. g. because it has been erased.SecurityError
NotReadableError
EncodingError
readAsArrayBuffer
in interface FileReaderSync
public final String readAsBinaryString(Blob blob)
FileReaderSync
This method reads the contents of the specified Blob
, which may be a File
. When the read operation is finished, it returns a DOMString
containing the raw binary data from the file. If an error happened during the read, the adequate exception is sent.
readAsArrayBuffer()
should be used instead.A
DOMString
containing the raw binary data from the resource
The following exceptions can be raised by this method:
NotFoundError
Blob
or File
cannot be found, e. g. because it has been erased.SecurityError
NotReadableError
EncodingError
readAsBinaryString
in interface FileReaderSync
public final String readAsDataURL(Blob blob)
FileReaderSync
This method reads the contents of the specified Blob
or File
. When the read operation is finished, it returns a data URL representing the file's data. If an error happened during the read, the adequate exception is sent.
An DOMString
representing the file's data as a data URL.
The following exceptions can be raised by this method:
NotFoundError
Blob
or File
cannot be found, e. g. because it has been erased.SecurityError
NotReadableError
EncodingError
readAsDataURL
in interface FileReaderSync
public final String readAsText(Blob blob)
FileReaderSync
This methods reads the specified blob's contents. When the read operation is finished, it returns a DOMString
containing the file represented as a text string. The optional encoding
parameter indicates the encoding to be used. If not present, the method will apply a detection algorithm for it. If an error happened during the read, the adequate exception is sent.
A DOMString
containing the raw binary data from the resource
The following exceptions can be raised by this method:
NotFoundError
Blob
or File
cannot be found, e. g. because it has been erased.SecurityError
NotReadableError
readAsText
in interface FileReaderSync
public final String readAsText(Blob blob, String encoding)
FileReaderSync
This methods reads the specified blob's contents. When the read operation is finished, it returns a DOMString
containing the file represented as a text string. The optional encoding
parameter indicates the encoding to be used. If not present, the method will apply a detection algorithm for it. If an error happened during the read, the adequate exception is sent.
A DOMString
containing the raw binary data from the resource
The following exceptions can be raised by this method:
NotFoundError
Blob
or File
cannot be found, e. g. because it has been erased.SecurityError
NotReadableError
readAsText
in interface FileReaderSync
Copyright © 2018. All rights reserved.