Module org.htmlunit

Class Blob.InMemoryBackend

java.lang.Object
org.htmlunit.javascript.host.file.Blob.Backend
org.htmlunit.javascript.host.file.Blob.InMemoryBackend
All Implemented Interfaces:
Serializable
Enclosing class:
Blob

protected static class Blob.InMemoryBackend extends Blob.Backend
Implementation of the Blob.Backend that stores the bytes in memory.
See Also:
  • Constructor Details

    • InMemoryBackend

      protected InMemoryBackend(byte[] bytes, String fileName, String type, long lastModified)
      Ctor.
      Parameters:
      bytes - the bytes
      fileName - the name
      type - the type
      lastModified - last modified
  • Method Details

    • create

      protected static Blob.InMemoryBackend create(org.htmlunit.corejs.javascript.NativeArray fileBits, String fileName, String type, long lastModified)
      Factory method to create an Blob.InMemoryBackend from an NativeArray.
      Parameters:
      fileBits - the bytes as NativeArray
      fileName - the name
      type - the type
      lastModified - last modified
      Returns:
      the new Blob.InMemoryBackend
    • getName

      public String getName()
    • getLastModified

      public long getLastModified()
    • getSize

      public long getSize()
    • getType

      public String getType(BrowserVersion browserVersion)
    • getText

      public String getText() throws IOException
      Throws:
      IOException
    • getBytes

      public byte[] getBytes(int start, int end)
    • getKeyDataPair

      public KeyDataPair getKeyDataPair(String name, String fileName, String contentType)