BlobBuilder API

A BlobBuilder is a helper object for creating Blobs.

Contents

  1. Overview
  2. BlobBuilder class

Overview

A Blob is an immutable, read-only object, the same as a JavaScript string. BlobBuilders are used to generate a Blob with new content. They are to Java's StringBuilder as Gears Blobs are to Java's Strings.

Permission

The BlobBuilder API does not require user permission.

BlobBuilder class

void append(data)
Blob getAsBlob()

Methods

void append(data)
Summary: Appends bytes to the Blob-in-progress.
Parameters: data - Either an integer, a string (which will be encoded as UTF-8), a Blob, or an array of appendable data (such as an array of a mix of strings and Blobs). For integer values, only the least significant byte of each integer will be appended.
Blob getAsBlob()
Summary: Bakes the previously appended data into a new, immutable Blob object.
Return value: A new Blob containing the previously appended data.