diffusion
Version:
Diffusion JavaScript client
40 lines (36 loc) • 1.13 kB
JavaScript
var _interface = require('util/interface')._interface;
/**
* Read-only interface for values that are internally represented as binary
* data.
*
* <p>
* This interface provides access to copies of the binary data, making instances
* effectively immutable. Methods of derived interfaces and classes that relax
* this restriction and expose access to the internal data should be clearly
* documented.
*
* @class diffusion.datatypes.Bytes
* @since 5.7
*/
module.exports = _interface('Bytes', [
/**
* @return {Number} The length of the data in bytes
* @function diffusion.datatypes.Bytes#length
*/
'length',
/**
* Get a copy of the buffer containing this value.
*
* @return {Buffer} This value in binary form
* @function diffusion.datatypes.Bytes#asBuffer
*/
'asBuffer',
/**
* Copy the binary data to a provided buffer.
*
* @param {Buffer} target - The buffer to copy data to
* @param {Number} [offset] - The position in the target buffer at which data will be copied
* @function diffusion.datatypes.Bytes#copyTo
*/
'copyTo'
]);