Class Blob

java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.file.Blob
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable
Direct Known Subclasses:
File

public class Blob extends HtmlUnitScriptable
A JavaScript object for Blob.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
     
    protected static class 
     

    Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Blob.Backend
     
    private static final String
     
    private static final String
     
    private static final String
     

    Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance.
    Blob(byte[] bits, String contentType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    protected static String
    extractFileTypeOrDefault(org.htmlunit.corejs.javascript.ScriptableObject properties)
     
    protected static long
    extractLastModifiedOrDefault(org.htmlunit.corejs.javascript.ScriptableObject properties)
     
    void
    fillRequest(WebRequest webRequest)
    Sets the specified request with the parameters in this FormData.
    protected Blob.Backend
     
    byte[]
     
    long
    Returns the size property.
    Returns the type property.
    void
    jsConstructor(org.htmlunit.corejs.javascript.NativeArray fileBits, org.htmlunit.corejs.javascript.ScriptableObject properties)
    Creates an instance.
    protected void
     
    slice(Object start, Object end, Object contentType)
     
     
     

    Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, 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

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Blob

      public Blob()
      Creates an instance.
    • Blob

      public Blob(byte[] bits, String contentType)
  • Method Details

    • extractFileTypeOrDefault

      protected static String extractFileTypeOrDefault(org.htmlunit.corejs.javascript.ScriptableObject properties)
    • extractLastModifiedOrDefault

      protected static long extractLastModifiedOrDefault(org.htmlunit.corejs.javascript.ScriptableObject properties)
    • jsConstructor

      public void jsConstructor(org.htmlunit.corejs.javascript.NativeArray fileBits, org.htmlunit.corejs.javascript.ScriptableObject properties)
      Creates an instance.
      Parameters:
      fileBits - the bits
      properties - the properties
    • getSize

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

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

      public Object arrayBuffer()
      Returns:
      a Promise that resolves with an ArrayBuffer containing the data in binary form.
    • slice

      public Blob slice(Object start, Object end, Object contentType)
    • stream

      public ReadableStream stream()
    • text

      public Object text()
      Returns:
      a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8.
    • getBytes

      public byte[] getBytes()
    • fillRequest

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

      protected Blob.Backend getBackend()
    • setBackend

      protected void setBackend(Blob.Backend backend)