@Override public void writeBytes(String s) { try { output.writeBytes(s); } catch (IOException impossible) { throw new AssertionError(impossible); } }
@Override public void write(DataOutput output) throws IOException { output.writeBytes("JMX"); } });
@Override public void writeBytes(String s) { try { output.writeBytes(s); } catch (IOException impossible) { throw new AssertionError(impossible); } }
@Override public void writeBytes(String s) { try { output.writeBytes(s); } catch (IOException impossible) { throw new AssertionError(impossible); } }
@Override public void writeBytes(String s) { try { output.writeBytes(s); } catch (IOException impossible) { throw new AssertionError(impossible); } }
@Override public void write(DataOutput output) throws IOException { output.writeBytes("JMX"); output.writeUTF(connectionId.toString()); } });
@Override public void write(DataOutput output) throws IOException { output.writeBytes("JMX"); output.writeByte(VersionTwo.getVersionIdentifier()); } });
@Override public void write(DataOutput output) throws IOException { output.writeBytes("JMX"); output.writeByte(VersionOne.getVersionIdentifier()); } });
/** * Writes a string as a fixed-size field, padded with zeros. */ public static void writeStringFixedSize(final DataOutput out, String s, int size) throws IOException { byte[] b = toBytes(s); if (b.length > size) { throw new IOException("Trying to write " + b.length + " bytes (" + toStringBinary(b) + ") into a field of length " + size); } out.writeBytes(s); for (int i = 0; i < size - s.length(); ++i) out.writeByte(0); }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
/** * Writes a string as a fixed-size field, padded with zeros. */ public static void writeStringFixedSize(final DataOutput out, String s, int size) throws IOException { byte[] b = toBytes(s); if (b.length > size) { throw new IOException("Trying to write " + b.length + " bytes (" + toStringBinary(b) + ") into a field of length " + size); } out.writeBytes(s); for (int i = 0; i < size - s.length(); ++i) out.writeByte(0); }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException { if (bs.readBoolean()) { // If we verified it only holds ascii values if (bs.readBoolean()) { dataOut.writeShort(value.length()); dataOut.writeBytes(value); } else { dataOut.writeUTF(value); } } }