How to use the thrift.TFramedTransport function in thrift

To help you get started, we’ve selected a few thrift examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ironSource / parquetjs / decode.js View on Github external
function parse(buffer, type) {
  var transport = new thrift.TFramedTransport(buffer)
  var protocol = new thrift.TCompactProtocol(transport)
  type.read(protocol)
  module.exports.bytes = parse.bytes = protocol.trans.readPos
  return type
}
github apache / thrift / lib / nodejs / examples / parse.js View on Github external
function parseThrift(thriftEncodedData, callback) {
  var thrift = require('thrift');
  var transport = new thrift.TFramedTransport(thriftEncodedData);
  var protocol  = new thrift.TBinaryProtocol(transport);

  var clientClass = require('../gen-nodejs/GENERATED').YOUR_CLASS_NAME;
  var client = new clientClass();
  client.read(protocol);
  callback(null, client);
}
github ironSource / parquetjs / lib / util.js View on Github external
exports.decodeThrift = function(obj, buf, offset) {
  if (!offset) {
    offset = 0;
  }

  var transport = new thrift.TFramedTransport(buf);
  transport.readPos = offset;
  var protocol = new thrift.TCompactProtocol(transport);
  obj.read(protocol);
  return transport.readPos - offset;
}