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

Class Blob

    • Constructor Detail

      • Blob

        public Blob()
        Creates an instance.
      • Blob

        public Blob(byte[] bytes,
         String contentType)
        Ctor.
        Parameters:
        bytes - the bytes
        contentType - the content type
    • Method Detail

      • getSize

        public long getSize()
        Returns the size property.
        Returns:
        the size property
      • getType

        public String getType()
        Returns the type property.
        Returns:
        the type property
      • slice

        public Blob slice(Object start,
         Object end,
         Object contentType)
        Parameters:
        start - An index into the Blob indicating the first byte to include in the new Blob. If you specify a negative value, it's treated as an offset from the end of the Blob toward the beginning. For example, -10 would be the 10th from last byte in the Blob. The default value is 0. If you specify a value for start that is larger than the size of the source Blob, the returned Blob has size 0 and contains no data.
        end - An index into the Blob indicating the first byte that will not be included in the new Blob (i.e. the byte exactly at this index is not included). If you specify a negative value, it's treated as an offset from the end of the Blob toward the beginning. For example, -10 would be the 10th from last byte in the Blob. The default value is size.
        contentType - The content type to assign to the new Blob; this will be the value of its type property. The default value is an empty string.
        Returns:
        a new Blob object which contains data from a subset of the blob on which it's called.
      • stream

        public ReadableStream stream()
        Returns:
        a ReadableStream which, upon reading, returns the contents of the Blob.
      • getBytes

        public byte[] getBytes()
        Returns:
        the bytes of this blob
      • fillRequest

        public void fillRequest(WebRequest webRequest)
        Sets the specified request with the parameters in this FormData.
        Parameters:
        webRequest - the web request to fill
      • getKeyDataPair

        public KeyDataPair getKeyDataPair(String name,
         String fileName)
        Delegates the KeyDataPair construction to the backend.
        Parameters:
        name - the name
        fileName - the filename
        Returns:
        the constructed KeyDataPair
      • setBackend

        protected void setBackend(Blob.Backend backend)
Skip navigation links

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

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