Binary Class Reference
[Types]
Description
The Binary class allows arbitrary binary data to be returned by a command. This data has an associated mime-type that is used to set the Content-type header when returning the data to the user.
Constructor
Functions
- clear()
- Clears all data and associated mime-type.
- set_data( ArrayBuffer data, String mime_type)
- Sets the binary data to return. More...
Properties
- Number byteLength
- Alias for data_size to mirror the native JavaScript ArrayBuffer interface.
- ArrayBuffer data
- Returns an ArrayBuffer containing a copy of the binary data. More...
- Number data_size
- The size of the binary data in bytes.
- String mime_type
- The mime type of the data. More...
Constructor
- Binary( ArrayBuffer data, String mime_type)
-
Parameters
- data
- The data to return. The contents of data will be copied.
- mime_type
- The mime-type of the data. Optional.
Functions
Properties
- Number Binary.byteLength
-
Alias for data_size to mirror the native JavaScript ArrayBuffer interface.
- ArrayBuffer Binary.data
-
Returns an ArrayBuffer containing a copy of the binary data. As this returns a copy modifying the ArrayBuffer will not modify the returned data. You will need to call set_data to return modified data.
- Number Binary.data_size
-
The size of the binary data in bytes.
- String Binary.mime_type
-
The mime type of the data. Also available as mime-type. Read-only