1 var BufferUtil = require('../utils/buffer')
2 var Mode = require('./mode')
4 function ByteData (data) {
6 this.data = BufferUtil.from(data)
9 ByteData.getBitsLength = function getBitsLength (length) {
13 ByteData.prototype.getLength = function getLength () {
14 return this.data.length
17 ByteData.prototype.getBitsLength = function getBitsLength () {
18 return ByteData.getBitsLength(this.data.length)
21 ByteData.prototype.write = function (bitBuffer) {
22 for (var i = 0, l = this.data.length; i < l; i++) {
23 bitBuffer.put(this.data[i], 8)
27 module.exports = ByteData