Search in sources :

Example 1 with StandardByteWriter

use of com.floweytf.utils.stdstreams.StandardByteWriter in project scripted-quests by TeamMonumenta.

the class ClientChatProtocol method sendJson.

private static void sendJson(Player player, JsonObject object) {
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    StandardByteWriter out = new StandardByteWriter(stream);
    try {
        out.write(GSON.toJson(object));
        player.sendPluginMessage(mPlugin, Constants.API_CHANNEL_ID, stream.toByteArray());
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : StandardByteWriter(com.floweytf.utils.stdstreams.StandardByteWriter) ByteArrayOutputStream(java.io.ByteArrayOutputStream)

Aggregations

StandardByteWriter (com.floweytf.utils.stdstreams.StandardByteWriter)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1