code: function (str, length, offset) {
  
                  str = str || '';
  
                  if (undefined === offset) {
                      offset = this.offset;
                  }
  
                  length  = length || str.replace(/[^\x00-\xff]/g, '11').length;
  
                  if (length < 0 || offset + length > this.length) {
                      error.raise(10002, this.length, offset + length);
                  }
  
                  this.seek(offset);
  
                  for (var i = 0, l = str.length, charCode; i < l; ++i) {
                      charCode = str.charCodeAt(i) || 0;
                      if (charCode > 127) {
                          // unicode编码可能会超出2字节,
                          // 写入与编码有关系，此处不做处理
                          this.writeUint16(charCode);
                      }
                      else {
                          this.writeUint8(charCode);
                      }
                  }
  
                  this.offset = offset + length;
  
                  return this;
              }
docs: 写入一个string
  
  @param {string} str 字符串
  @param {number=} length 长度
  @param {number=} offset 偏移
  
  @return {this}