public class FileReader extends EventTarget
FileReader
.Modifier and Type | Field and Description |
---|---|
static short |
DONE
The entire read request has been completed.
|
static short |
EMPTY
No data has been loaded yet.
|
static short |
LOADING
Data is currently being loaded.
|
Constructor and Description |
---|
FileReader()
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnerror()
Returns the
onerror event handler for this FileReader . |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnload()
Returns the
onload event handler for this FileReader . |
int |
getReadyState()
Returns the current state of the reading operation.
|
Object |
getResult()
Returns the file's contents.
|
void |
readAsArrayBuffer(Object object)
|
void |
readAsDataURL(Object object)
|
void |
readAsText(Object object,
Object encoding)
|
void |
setOnerror(Object onerror)
Sets the
onerror event handler for this FileReader . |
void |
setOnload(Object onload)
Sets the
onload event handler for this FileReader . |
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandler
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
public static final short EMPTY
public static final short LOADING
public static final short DONE
public int getReadyState()
public Object getResult()
public void readAsDataURL(Object object) throws IOException
object
- the Blob
or File
from which to readIOException
- if an error occurspublic void readAsArrayBuffer(Object object) throws IOException
object
- the Blob
or File
from which to readIOException
- if an error occurspublic void readAsText(Object object, Object encoding) throws IOException
Blob
or File
.
When the read operation is complete, the readyState is changed to DONE,
the loaded event is triggered, and the result attribute contains the
contents of the file as a text string.object
- the Blob
or File
from which to readencoding
- the encodingIOException
- if an error occurspublic net.sourceforge.htmlunit.corejs.javascript.Function getOnload()
onload
event handler for this FileReader
.onload
event handler for this FileReader
public void setOnload(Object onload)
onload
event handler for this FileReader
.onload
- the onload
event handler for this FileReader
public net.sourceforge.htmlunit.corejs.javascript.Function getOnerror()
onerror
event handler for this FileReader
.onerror
event handler for this FileReader
public void setOnerror(Object onerror)
onerror
event handler for this FileReader
.onerror
- the onerror
event handler for this FileReader
Copyright © 2002–2022 Gargoyle Software Inc.. All rights reserved.