Code example for DataOutput

Methods: writeFloat, writeUTF

0
		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() {
		return name + " " + Float.toString(weight);
	} 
}