Package dev.gmitch215.bytebox.binding
Interface R2Bucket.R2ObjectBody
- All Superinterfaces:
org.teavm.jso.JSObject,R2Bucket.R2Object
- Enclosing interface:
R2Bucket
An object's metadata together with its body.
A body can be read once. Reading it twice raises, because it is a stream.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault org.teavm.jso.typedarrays.ArrayBufferbytes()Returns the body, as bytes.default TSObjectjson()Returns the body, parsed as JSON.org.teavm.jso.core.JSPromise<org.teavm.jso.typedarrays.ArrayBuffer> org.teavm.jso.core.JSPromise<TSObject> readJson()org.teavm.jso.core.JSPromise<org.teavm.jso.core.JSString> readText()default Stringtext()Returns the body, decoded as UTF-8.Methods inherited from interface org.teavm.jso.JSObject
castMethods inherited from interface dev.gmitch215.bytebox.binding.R2Bucket.R2Object
getCustomMetadata, getEtag, getHttpMetadata, getKey, getSize, getVersion
-
Method Details
-
text
Returns the body, decoded as UTF-8.- Returns:
- the body, decoded as UTF-8
-
bytes
default org.teavm.jso.typedarrays.ArrayBuffer bytes()Returns the body, as bytes.- Returns:
- the body, as bytes
-
json
Returns the body, parsed as JSON.- Returns:
- the body, parsed as JSON
-
readText
org.teavm.jso.core.JSPromise<org.teavm.jso.core.JSString> readText() -
readBytes
org.teavm.jso.core.JSPromise<org.teavm.jso.typedarrays.ArrayBuffer> readBytes() -
readJson
org.teavm.jso.core.JSPromise<TSObject> readJson()
-