Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
405 B
19 lines
405 B
5 years ago
|
/**
|
||
|
* @fileoverview Helper methods to create BufferDecoders.
|
||
|
*/
|
||
|
goog.module('protobuf.binary.bufferDecoderHelper');
|
||
|
|
||
|
const BufferDecoder = goog.require('protobuf.binary.BufferDecoder');
|
||
|
|
||
|
/**
|
||
|
* @param {...number} bytes
|
||
|
* @return {!BufferDecoder}
|
||
|
*/
|
||
|
function createBufferDecoder(...bytes) {
|
||
|
return BufferDecoder.fromArrayBuffer(new Uint8Array(bytes).buffer);
|
||
|
}
|
||
|
|
||
|
exports = {
|
||
|
createBufferDecoder,
|
||
|
};
|