@Test public void testSerializeContents() throws Exception { T instance = createInitializedInstance(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); getSerializer().serializeContents(instance, new DataOutputStream(baos)); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); T output = createInstance(); assertThat(getSerializer().deserializeContents(output, new DataInputStream(bais))).isTrue(); assertThat(output).isEqualTo(instance); }
public abstract void serializeContents(T metrics, DataOutput output) throws IOException;
SystemMetricsSerializer { public abstract void serializeContents(T metrics, DataOutput output) throws IOException; }
SystemMetricsSerializer { public abstract void serializeContents(T metrics, DataOutput output) throws IOException;  }
SystemMetricsSerializer { public abstract void serializeContents(T metrics, DataOutput output) throws IOException;  final void serialize(T metrics, DataOutput output); final boolean deserialize(T metrics, DataInput input); abstract long getTag(); abstract void serializeContents(T metrics, DataOutput output); abstract boolean deserializeContents(T metrics, DataInput input); }
SystemMetricsSerializer { public abstract void serializeContents(T metrics, DataOutput output) throws IOException;  final void serialize(T metrics, DataOutput output); final boolean deserialize(T metrics, DataInput input); abstract long getTag(); abstract void serializeContents(T metrics, DataOutput output); abstract boolean deserializeContents(T metrics, DataInput input);  }