java.lang.Object
org.htmlunit.javascript.host.file.Blob.Backend
org.htmlunit.javascript.host.file.Blob.InMemoryBackend
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Blob
Implementation of the
Blob.Backend that stores the bytes in memory.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInMemoryBackend(byte[] bytes, String fileName, String type, long lastModified) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static Blob.InMemoryBackendcreate(org.htmlunit.corejs.javascript.NativeArray fileBits, String fileName, String type, long lastModified) Factory method to create anBlob.InMemoryBackendfrom anNativeArray.byte[]getBytes(int start, int end) getKeyDataPair(String name, String fileName, String contentType) longgetName()longgetSize()getText()getType(BrowserVersion browserVersion)
-
Constructor Details
-
InMemoryBackend
Ctor.- Parameters:
bytes- the bytesfileName- the nametype- the typelastModified- 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 anBlob.InMemoryBackendfrom anNativeArray.- Parameters:
fileBits- the bytes asNativeArrayfileName- the nametype- the typelastModified- last modified- Returns:
- the new
Blob.InMemoryBackend
-
getName
-
getLastModified
public long getLastModified() -
getSize
public long getSize() -
getType
-
getText
- Throws:
IOException
-
getBytes
public byte[] getBytes(int start, int end) -
getKeyDataPair
-