Code example for DataOutput

Methods: writeLong

0
        return this;
    } 
 
    @Override 
    public void write(final DataOutput out) throws IOException {
        out.writeLong(this.weight);
        super.write(out);
 
    } 
 
    @Override 
    public void readFields(final DataInput in) throws IOException {
        this.weight = in.readLong();
        super.readFields(in);
    } 
 
    @Override 
    public boolean equals(final Object object) {
        // TODO: what is equality? 
        return object.getClass().equals(WeightedWritable.class) && ((WeightedWritable) object).get().equals(this.get());
    }