Interface R2Bucket.R2ObjectBody

All Superinterfaces:
org.teavm.jso.JSObject, R2Bucket.R2Object
Enclosing interface:
R2Bucket

public static interface R2Bucket.R2ObjectBody extends R2Bucket.R2Object
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 Type
    Method
    Description
    default org.teavm.jso.typedarrays.ArrayBuffer
    Returns the body, as bytes.
    default TSObject
    Returns the body, parsed as JSON.
    org.teavm.jso.core.JSPromise<org.teavm.jso.typedarrays.ArrayBuffer>
     
    org.teavm.jso.core.JSPromise<TSObject>
     
    org.teavm.jso.core.JSPromise<org.teavm.jso.core.JSString>
     
    default String
    Returns the body, decoded as UTF-8.

    Methods inherited from interface org.teavm.jso.JSObject

    cast

    Methods inherited from interface dev.gmitch215.bytebox.binding.R2Bucket.R2Object

    getCustomMetadata, getEtag, getHttpMetadata, getKey, getSize, getVersion
  • Method Details

    • text

      default String 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

      default TSObject 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()