6d0883e2e5b9478ee705d481230581266127618b4a7f2428b0ea88b30ef77b50.json raw

   1  {"ast":null,"code":"const Mode = require('./mode');\nfunction ByteData(data) {\n  this.mode = Mode.BYTE;\n  if (typeof data === 'string') {\n    this.data = new TextEncoder().encode(data);\n  } else {\n    this.data = new Uint8Array(data);\n  }\n}\nByteData.getBitsLength = function getBitsLength(length) {\n  return length * 8;\n};\nByteData.prototype.getLength = function getLength() {\n  return this.data.length;\n};\nByteData.prototype.getBitsLength = function getBitsLength() {\n  return ByteData.getBitsLength(this.data.length);\n};\nByteData.prototype.write = function (bitBuffer) {\n  for (let i = 0, l = this.data.length; i < l; i++) {\n    bitBuffer.put(this.data[i], 8);\n  }\n};\nmodule.exports = ByteData;","map":null,"metadata":{},"sourceType":"script","externalDependencies":[]}