code: function writeValue(marker, type, value) {
    switch (type) {
      case DATA_TYPES.INTEGER:
        return writeInt(marker, value);
  
      case DATA_TYPES.ARRAY_START:
        return writeArrayLen(marker, value);
  
      case DATA_TYPES.STRING:
        return writeString(marker, value);
  
      default:
        throw new Error('I don\'t know how to write type ' + type);
    }
  }
docs: Helper functions