JavaScript is disabled on your browser.
Skip navigation links
org.htmlunit.javascript.host.file

Class FileReader

    • Field Detail

      • LOADING

        public static final int LOADING
        Data is currently being loaded.
        See Also:
        Constant Field Values
      • DONE

        public static final int DONE
        The entire read request has been completed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FileReader

        public FileReader()
    • Method Detail

      • getReadyState

        public int getReadyState()
        Returns the current state of the reading operation.
        Returns:
        0, 1, or 2
      • getResult

        public Object getResult()
        Returns the file's contents.
        Returns:
        the file's contents
      • readAsDataURL

        public void readAsDataURL(Object object)
         throws IOException 
        Reads the contents of the specified Blob or File.
        Parameters:
        object - the Blob or File from which to read
        Throws:
        IOException - if an error occurs
      • readAsArrayBuffer

        public void readAsArrayBuffer(Object object)
        Reads the contents of the specified Blob or File.
        Parameters:
        object - the Blob or File from which to read
      • readAsText

        public void readAsText(Object object,
         Object encoding)
        Reads the contents of the specified 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.
        Parameters:
        object - the Blob or File from which to read
        encoding - the encoding
      • setOnload

        public void setOnload(Object onload)
        Sets the onload event handler for this FileReader.
        Parameters:
        onload - the onload event handler for this FileReader
      • setOnerror

        public void setOnerror(Object onerror)
        Sets the onerror event handler for this FileReader.
        Parameters:
        onerror - the onerror event handler for this FileReader
Skip navigation links

Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /