public void testNewDataOutput_writeBoolean() { ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeBoolean(true); out.writeBoolean(false); byte[] expected = {(byte) 1, (byte) 0}; assertEquals(expected, out.toByteArray()); }
@Override public void writeTo(ByteArrayDataOutput output) { output.writeBoolean(willEnable); output.writeUTF(playerName); output.writeBoolean(isSourceInvoker); }
@Override public void writeTo(ByteArrayDataOutput out) { out.writeUTF(commandName); out.writeUTF(args); out.writeBoolean(isSource); out.writeBoolean(isOP); }
public void sendOnGround(){ ByteArrayDataOutput buf = ByteStreams.newDataOutput(); try{ Packet.writeVarInt(buf, 3); buf.writeBoolean(c.onground); c.net.sendPacket(buf, c.out); }catch(IOException e){ e.printStackTrace(); } }
@Override public void writeTo(ByteArrayDataOutput out) { out.writeInt(targetSkin.getRowId()); out.writeUTF(targetSkin.getEncodedValue()); out.writeUTF(targetSkin.getSignature()); out.writeUTF(receiverUUD.toString()); out.writeBoolean(skinPerm); out.writeBoolean(isOp); }
public void testNewDataOutput_writeBoolean() { ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeBoolean(true); out.writeBoolean(false); byte[] expected = {(byte) 1, (byte) 0}; assertEquals(expected, out.toByteArray()); }
@Override public void writeTo(ByteArrayDataOutput out) { out.writeBoolean(allowed); out.writeInt(skin.getRowId()); out.writeUTF(skin.getEncodedValue()); out.writeUTF(skin.getSignature()); out.writeUTF(receiverUUID.toString()); }
private <T> void updateData(UUID uuid, DataKey<T> key, T value) { try { ByteArrayDataOutput data = ByteStreams.newDataOutput(); DataStreamUtils.writeUUID(data, uuid); DataStreamUtils.writeDataKey(data, key); data.writeBoolean(value == null); if (value != null) { typeRegistry.getTypeAdapter(key.getType()).write(data, value); } RedisBungee.getApi().sendChannelMessage(CHANNEL_DATA_UPDATE, Base64.getEncoder().encodeToString(data.toByteArray())); } catch (RuntimeException ex) { BungeeTabListPlus.getInstance().getLogger().log(Level.WARNING, "RedisBungee Error", ex); } catch (Throwable th) { BungeeTabListPlus.getInstance().getLogger().log(Level.SEVERE, "Failed to send data", th); } }
public static byte[] getBinPatchBytesWithHeader(Delta delta, String cleanName, String srgName, byte[] clean, byte[] dirty) throws IOException { byte[] diff = delta.compute(clean == null ? new byte[0] : clean, dirty); ByteArrayDataOutput out = ByteStreams.newDataOutput(diff.length + 50); out.writeUTF(cleanName); // Clean name out.writeUTF(cleanName.replace('/', '.')); // Source Notch name out.writeUTF(srgName.replace('/', '.')); // Source SRG Name out.writeBoolean(clean != null); // Exists in Clean if (clean != null) { out.writeInt(adlerHash(clean)); // Hash of Clean file } out.writeInt(diff.length); // Patch length out.write(diff); // Patch return out.toByteArray(); }
public void move(double x, double y, double z) { ByteArrayDataOutput buf = ByteStreams.newDataOutput(); try{ Packet.writeVarInt(buf, 14); buf.writeDouble(x); buf.writeDouble(y); buf.writeDouble(z); buf.writeFloat(c.yaw); buf.writeFloat(c.pitch); buf.writeBoolean(c.onground); c.net.sendPacket(buf, c.out); }catch(IOException e){ e.printStackTrace(); } }
output.writeUTF(subj); output.writeUTF(RdfCloudTripleStoreConstants.SUBJECT_CF); output.writeBoolean(includesContext); if (includesContext) { output.writeUTF(scontext_str); output.writeUTF(pred); output.writeUTF(RdfCloudTripleStoreConstants.PRED_CF); output.writeBoolean(includesContext); if (includesContext) { output.writeUTF(scontext_str);
output.writeUTF(subj); output.writeUTF(RdfCloudTripleStoreConstants.SUBJECT_CF); output.writeBoolean(includesContext); if (includesContext) { output.writeUTF(scontext_str); output.writeUTF(pred); output.writeUTF(RdfCloudTripleStoreConstants.PRED_CF); output.writeBoolean(includesContext); if (includesContext) { output.writeUTF(scontext_str);
@Override public void read(Client c, int len, ByteArrayDataInputWrapper buf) throws IOException{ c.entityID = buf.readInt(); c.gamemode = buf.readByte(); c.dimension = buf.readByte(); c.difficulty = buf.readByte(); c.maxplayer = buf.readByte(); System.out.println("Level type is: " + getString(buf)); ByteArrayDataOutput buff = ByteStreams.newDataOutput(); try{ Packet.writeVarInt(buff, 4); Packet.writeString(buff, "en_GB"); buff.writeByte(0); Packet.writeVarInt(buff, 0); buff.writeBoolean(true); buff.writeByte(0); Packet.writeVarInt(buff, 1); c.net.sendPacket(buff, c.out); }catch(IOException e){ e.printStackTrace(); } }