@Override public void readFields(DataInput in) throws IOException { wrapped = PolymorphicWritable.read(in, Mapping.class); } }
@Override public void write(DataOutput dataOutput) throws IOException { PolymorphicWritable.write(dataOutput, wrapped); }
private static <T extends Writable> T roundTrip(T m, Class<T> clazz) throws IOException { ByteArrayOutputStream buf = new ByteArrayOutputStream(1000); DataOutputStream dos = new DataOutputStream(buf); try { PolymorphicWritable.write(dos, m); } finally { Closeables.close(dos, false); } return PolymorphicWritable.read(new DataInputStream(new ByteArrayInputStream(buf.toByteArray())), clazz); }
ByteArrayOutputStream byteArrayOutputStream = closer.register(new ByteArrayOutputStream()); DataOutputStream dataOutputStream = closer.register(new DataOutputStream(byteArrayOutputStream)); PolymorphicWritable.write(dataOutputStream, lr); output = byteArrayOutputStream.toByteArray(); } finally { ByteArrayInputStream byteArrayInputStream = closer.register(new ByteArrayInputStream(output)); DataInputStream dataInputStream = closer.register(new DataInputStream(byteArrayInputStream)); read = closer.register(PolymorphicWritable.read(dataInputStream, OnlineLogisticRegression.class)); } finally { closer.close();
@Override public void write(DataOutput out) throws IOException { PolymorphicWritable.write(out, value); }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, ClusteringPolicy.class); }
@Override public void write(DataOutput out) throws IOException { PolymorphicWritable.write(out, value); }
@Override public void readFields(DataInput in) throws IOException { wrapped = PolymorphicWritable.read(in, Mapping.class); } }
@Override public void write(DataOutput out) throws IOException { PolymorphicWritable.write(out, value); }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, ClusteringPolicy.class); }
@Override public void write(DataOutput dataOutput) throws IOException { PolymorphicWritable.write(dataOutput, wrapped); }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, Cluster.class); }
@Override public void write(DataOutput dataOutput) throws IOException { PolymorphicWritable.write(dataOutput, wrapped); }
@Override public void readFields(DataInput in) throws IOException { wrapped = PolymorphicWritable.read(in, Mapping.class); } }
@Override public void write(DataOutput out) throws IOException { PolymorphicWritable.write(out, value); }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, Cluster.class); }
@Override public void write(DataOutput out) throws IOException { PolymorphicWritable.write(out, value); }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, Cluster.class); }
@Override public void write(DataOutput out) throws IOException { PolymorphicWritable.write(out, value); }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, ClusteringPolicy.class); }