Code example for DataInput

Methods: readFloat, readUTF

0
		this.name = name;
		this.weight = weight;
	} 
 
	public void readFields(DataInput in) throws IOException {
		name = in.readUTF();
		weight = in.readFloat();
	} 
 
	public void write(DataOutput out) throws IOException {
		out.writeUTF(name);
		out.writeFloat(weight);
	} 
	 
    public static Edge read(DataInput in) throws IOException {
    	Edge w = new Edge();
    	w.readFields(in);
        return w;
	} 
	 
	public String toString() {