Send JSON representation of given data object to all connections of a user
@param data the data object
@param username the username
482019
public void sendJsonToUser(Object data, String username) {
        sendToUser(JSON.toJSONString(data), username);
    }
205951
public void setData(byte[] data) throws IOException {
        output = new ByteArrayOutputStream();
        output.write(data);
        output.flush();
        setContentLength(output.size());
    }
981323
public RequestContext renderData(final Object data) {
        if (renderer instanceof JsonRenderer) {
            final JsonRenderer r = (JsonRenderer) renderer;

            final JSONObject ret = r.getJSONObject();
            ret.put(Keys.DATA, data);
        }

        return this;
    }
1073581
public Connection<A> createConnection(ConnectionData data) {
		return new OAuth1Connection<A>(data, getOAuth1ServiceProvider(), getApiAdapter());
	}
600386
public BaseDataJsonFieldBo setData(String data) {
        setAttribute(ATTR_DATA, data != null ? data.trim() : "{}");
        return this;
    }
1336142
public boolean addUserData(Object userData) {
		if (this.userData == null) {
			this.userData = new ArrayList<>();
		}
		return this.userData.add(userData);
	}
448274
public void setData(byte[] data) {
        if (immutable) {
            throw new IllegalStateException(ERR_MSG_IMMUTABLE);
        }
        if (data == null) {
            this.data = null;
        } else {
            setData(data, 0, data.length);
        }
    }
619671
public function sendDataAsJson($data) {
    $this->disableView();
    $this->setContentType('application/json', 'UTF-8');
    if (is_object($data)) {
      if (method_exists($data,'toArray'))
        $data = $data->toArray();
    }
    if (empty($data))
      $data = new \stdClass();
    
    $this->setJsonContent($data);
    $this->send();
  }
328530
function serializeUserData(object) {
      try {
        return JSON.parse(JSON.stringify(object.userData));
      } catch (error) {
        console.warn(
          "THREE.GLTFExporter: userData of '" +
            object.name +
            "' " +
            "won't be serialized because of JSON.stringify error - " +
            error.message
        );

        return {};
      }
    }
554157
public WebhookMessageBuilder setUsername(String username)
    {
        this.username = Helpers.isBlank(username) ? null : username;
        return this;
    }
190012
public void sendData(Object req, Object res)
        throws Exception, IOException
    {
        this.sendData((HttpServletRequest)req, (HttpServletResponse)res);
    }
980953
public void setThisData(byte[] data)
    {
        try
        {
            pen.setData(data);
        }
        catch ( Exception e )
        {
            ThreadUtils.checkInterrupted(e);
            Throwables.propagate(e);
        }
    }
567535
public void writeData(String data) {
        _buffer.append("<![CDATA[");
        _buffer.append( data);
        _buffer.append( "]]>");
    }
45505
public void setUserDataAt(int index, Object data) {
		if (this.userData == null) {
			throw new IndexOutOfBoundsException();
		}
		this.userData.set(index, data);
	}
1145968
public void write(final String data) throws IOException {
        if (socket != null) {
            out.write(data.getBytes());
        }
    }
1365216
public WebSocketContext sendJsonToTagged(Object data, String tag) {
        return sendToTagged(JSON.toJSONString(data), tag);
    }
499282
public RequestResponse setResponseData(byte[] responseData) {
        this.responseData = responseData;
        try {
            responseJson = responseData != null ? SerializationUtils.readJson(responseData) : null;
        } catch (Exception e) {
            responseJson = null;
            LOGGER.error(e.getMessage(), e);
        }
        return this;
    }