MCPcopy Create free account
hub / github.com/ReactJSResources/react-webpack-babel / encodeAsBinary

Function encodeAsBinary

public/bundle.js:1172–1184  ·  view source on GitHub ↗

* Encode packet as 'buffer sequence' by removing blobs, and * deconstructing packet into object with placeholders and * a list of buffers. * * @param {Object} packet * @return {Buffer} encoded * @api private

(obj, callback)

Source from the content-addressed store, hash-verified

1170 */
1171
1172 function encodeAsBinary(obj, callback) {
1173
1174 function writeEncoding(bloblessData) {
1175 var deconstruction = binary.deconstructPacket(bloblessData);
1176 var pack = encodeAsString(deconstruction.packet);
1177 var buffers = deconstruction.buffers;
1178
1179 buffers.unshift(pack); // add packet info to beginning of data list
1180 callback(buffers); // write all the buffers
1181 }
1182
1183 binary.removeBlobs(obj, writeEncoding);
1184 }
1185
1186 /**
1187 * A socket.io Decoder instance

Callers 1

bundle.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected